Why does STD return NaN for financial time series with missing values (NaNs)?
Show older comments
STD returns NaN when operating on financial time series containing NaN values. This happens when I execute the code below:
dates = {'jan-01-2001'; 'jan-02-2001'; 'jan-03-2001'; ...
'jan-04-2001'; 'jan-06-2001'};
data = [1; NaN; 1; NaN; 1];
t1 = fints(dates, data);
std(t1)
This behavior is also observed when I use MEAN on the same object.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!