covariance matrix [message #91809] |
Sun, 30 August 2015 14:30  |
siumtesfai
Messages: 62 Registered: April 2013
|
Member |
|
|
Hello all
I have filled my missing value with NAN
data = Array[4176, 168]
ntime= 168
I am interested in calculating covariance matrix
matrix = (1/ntime-1) * (Double(data) ## Transpose(data))
I found this result
result = Array[168, 168]
Min = NaN
Max = NaN
Any help would be appreciate on how to do the covariance matrix on the good data with exclusion of missing data
Best regards
|
|
|
Re: covariance matrix [message #91811 is a reply to message #91809] |
Sun, 30 August 2015 16:46  |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
On Sunday, August 30, 2015 at 3:30:41 PM UTC-6, siumt...@gmail.com wrote:
> Hello all
>
> I have filled my missing value with NAN
>
> data = Array[4176, 168]
>
> ntime= 168
>
> I am interested in calculating covariance matrix
>
> matrix = (1/ntime-1) * (Double(data) ## Transpose(data))
>
>
> I found this result
>
>
>
> result = Array[168, 168]
> Min = NaN
> Max = NaN
>
>
> Any help would be appreciate on how to do the covariance matrix on the good data with exclusion of missing data
>
> Best regards
Is it adequate to eliminate NaNs in your derived values rather than filter them prior to your calculation?
data = randomu(seed, 4176, 168)
data[randomu(seed, 336)*(4176*168L)] = !values.f_nan
matrix = (1/ntime - 1)*(Double(data) ## Transpose(data))
print, min(matrix)
NaN
print, min(matrix, /nan)
-1410.1838
|
|
|