help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: correlation with nan?


From: James Sherman Jr.
Subject: Re: correlation with nan?
Date: Thu, 20 May 2010 13:42:34 -0400

If you're just looking to calculate the correlation coefficient between two variables, couldn't you just do something like:
nan_indices = or(isnan(x), isnan(y));
xhat = x(~nan_indices);
yhat = y(~nan_indices);

correlation_coeff = mean((xhat-mean(xhat)).*(yhat-mean(yhat)))./(std(xhat)*std(yhat));

Hope this helps.

On Thu, May 20, 2010 at 12:39 PM, Stefan Neumann <address@hidden> wrote:
Hi

is there a way to calculate a correlation when the data contains NaN ?

The nan-toolbox does not seem to have this.

THX
Stefan

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]