{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/Surus/issues/7","labels_url":"https://api.github.com/repos/Netflix/Surus/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Surus/issues/7/comments","events_url":"https://api.github.com/repos/Netflix/Surus/issues/7/events","html_url":"https://github.com/Netflix/Surus/issues/7","id":77420353,"number":7,"title":"Error in AnomalyDetection.rpca","user":{"login":"punsiitg","id":6467832,"avatar_url":"https://avatars.githubusercontent.com/u/6467832?v=3","gravatar_id":"","url":"https://api.github.com/users/punsiitg","html_url":"https://github.com/punsiitg","followers_url":"https://api.github.com/users/punsiitg/followers","following_url":"https://api.github.com/users/punsiitg/following{/other_user}","gists_url":"https://api.github.com/users/punsiitg/gists{/gist_id}","starred_url":"https://api.github.com/users/punsiitg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punsiitg/subscriptions","organizations_url":"https://api.github.com/users/punsiitg/orgs","repos_url":"https://api.github.com/users/punsiitg/repos","events_url":"https://api.github.com/users/punsiitg/events{/privacy}","received_events_url":"https://api.github.com/users/punsiitg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-17T22:54:07Z","updated_at":"2015-05-26T19:40:34Z","closed_at":null,"body":"Hi,\r\n\r\nI am using the R version of Anomaly Detection and am coming across an error. Here are the details:\r\n\r\nError:\r\n\r\nAnomalyDetection.rpca(ts)\r\nError in data.frame(X.transform = X.transform, L.transform = L.transform,  : \r\n  arguments imply differing number of rows: 231, 227\r\nIn addition: Warning message:\r\nIn matrix((j - j.global.mean)/j.global.sd, nrow = frequency) :\r\n  data length [227] is not a sub-multiple or multiple of the number of rows [7]\r\n\r\nHere's how to reproduce it:\r\n\r\nts <- c(54,28,56,98,105,3,96,70,56,56,30,48,42,42,70,2,48,63,70,66,99,1,54,112,21,56,3,9,4,8,14,15,2,20,8,8,1,3,8,6,6,10,1,8,9,7,6,9,6,18,8,16,28,30,6,4,32,20,16,16,88,2,6,16,12,12,20,4,2,16,18,14,12,18,2,8,24,30,8,10,81,196,6,32,21,27,8,7,9,9,40,8,40,24,10,6,18,52,120,196,180,27,32,100,112,96,484,2,18,88,78,78,120,18,16,108,91,72,108,10,654,2169,1252,2480,4704,4995,612,174,3328,2940,2424,2504,8008,104,666,2184,1806,1866,2930,380,87,1736,2817,2135,1896,2736,187,18,90,40,80,140,150,30,20,160,100,80,80,132,3,9,24,18,18,30,6,3,24,27,21,18,27,3,117,76,152,252,285,39,4,256,190,144,144,572,2,36,104,102,114,170,34,13,136,162,140,126,171,15,258,513,404,808,1344,1425,270,152,912,1000,736,720,4312,86,168,776,564,576,990,188,86,472,918,728,576,819,89)\r\n\r\nAnomalyDetection.rpca(ts)\r\n\r\nKindly let me know how the issue can be resolved. I am stuck on a project due to the above issue.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/Netflix/Surus/issues/comments/105644250","html_url":"https://github.com/Netflix/Surus/issues/7#issuecomment-105644250","issue_url":"https://api.github.com/repos/Netflix/Surus/issues/7","id":105644250,"user":{"login":"mmolaro","id":9060669,"avatar_url":"https://avatars.githubusercontent.com/u/9060669?v=3","gravatar_id":"","url":"https://api.github.com/users/mmolaro","html_url":"https://github.com/mmolaro","followers_url":"https://api.github.com/users/mmolaro/followers","following_url":"https://api.github.com/users/mmolaro/following{/other_user}","gists_url":"https://api.github.com/users/mmolaro/gists{/gist_id}","starred_url":"https://api.github.com/users/mmolaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmolaro/subscriptions","organizations_url":"https://api.github.com/users/mmolaro/orgs","repos_url":"https://api.github.com/users/mmolaro/repos","events_url":"https://api.github.com/users/mmolaro/events{/privacy}","received_events_url":"https://api.github.com/users/mmolaro/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T19:40:34Z","updated_at":"2015-05-26T19:40:34Z","body":"The full signature for AnomalyDetection.rpca is given below: You can see that it assumes the data has a periodicity (called frequency) of 7 unless another value is passed. Your data must be divisible by 7 if you don't pass a value for frequency when calling the function. I'd recommend using frequency=1 if you don't have an expectation of periodicity in your data. \r\n\r\nAnomalyDetection.rpca(X, frequency = 7, dates = NULL, autodiff = T,\r\nforcediff = F, scale = T, L.penalty = 1,\r\ns.penalty = 1.4/sqrt(max(frequency, ifelse(is.data.frame(X), nrow(X),\r\nlength(X))/frequency)), verbose = F)"}}