This question has been asked but wasn't answered (Circular-linear regression from circular package in R not working).
I'm using the circular package in R to do circular-linear regression, and am getting the error "Error in while (diff > tol) { : missing value where TRUE/FALSE needed."
Specifically, I'm entering as inputs:
- y (vector of data for the circular dependent variable; class(y) = "circular" "numeric")
- x (matrix of data for the linear independent variables; class(x) = "matrix")
- init (I'm using c(rep(0, numColsOfx; class(init) = "numeric")
Then, I run
lm.circular(y = y, x = x, init = start, type = "c-l", verbose = TRUE)
I've checked my data types against those in the following example (which runs fine): http://www.inside-r.org/packages/cran/circular/docs/lm.circular.
Any tips would be much appreciated!
EDIT: Here are some example data. I don't know if a good fit is possible here, I just want the algorithm to run in the first place.
x =
13 49 75 17 58 93 92 94 32 82
47 85 64 7 55 14 64 43 86 4
20 81 95 20 40 67 11 50 77 67
18 49 68 70 78 40 40 10 48 87
87 96 49 88 24 23 21 2 44 9
startY =
4.7298
1.3788
1.1519
1.7802
3.5779
y = circular(startY, type = c("angles"), units = c("radians"), template = "none", modulo = c("asis"), zero = 0, rotation = c("counter"))
init = c(rep(0, 10))