Displaying 1 result from an estimated 1 matches for "nanerror".
Did you mean:
anerror
2013 Mar 08
1
getting covariance ignoring NaN missing values
...) value the covariance estimation gets thrown off.
Is there a robust way to do this?
Thanks,
Sachin
a=array(rnorm(9),dim=c(3,3))> a [,1] [,2] [,3]
[1,] -0.79418236 0.7813952 0.855881
[2,] -1.65347906 -1.9462446 -0.376325
[3,] -0.03144987 0.6756862 -1.879801> a[3,2]=NANError: object 'NAN'
not found> a[3,2]=NaN> a [,1] [,2] [,3]
[1,] -0.79418236 0.7813952 0.855881
[2,] -1.65347906 -1.9462446 -0.376325
[3,] -0.03144987 NaN -1.879801> cov(a) [,1] [,2] [,3]
[1,] 0.6585217 NA -0.5777408
[2,] NA NA...