SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
deepvalue
Topic Author
Posts: 918
Joined: April 25th, 2007, 6:08 am

how does matlab handle missing or NaN data points?

November 19th, 2008, 7:44 am

I am trying to suppress the use of NaN data points in computing the mean. How do I do this without a special toolkit?
 
User avatar
BramJ
Posts: 372
Joined: January 10th, 2006, 2:01 pm

how does matlab handle missing or NaN data points?

November 19th, 2008, 7:59 am

I don't have matlab at my desk here, but something likemean(yourArray(find(~isnan(yourArray)))should do the trick
Last edited by BramJ on November 18th, 2008, 11:00 pm, edited 1 time in total.
 
User avatar
CTD
Posts: 28
Joined: October 24th, 2007, 3:31 pm

how does matlab handle missing or NaN data points?

November 19th, 2008, 10:24 pm

Believe the function NANMEAN might be a bit more straightforward.
 
User avatar
lehalle
Posts: 50
Joined: April 19th, 2006, 7:13 am

how does matlab handle missing or NaN data points?

December 13th, 2008, 12:10 pm

nanmean( data) and quantile( data, .5) work if you have the statistical toolboxmean(data(~isnan(data))) works with plain matlab (no need for a find)
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On