Products & Services Industries Academia Support User Community Company

Learn more about Financial Toolbox   

nanmedian - Median ignoring NaNs

Syntax

m = nanmedian(X)
m = nanmedian(X,DIM)

Arguments

X

Financial times series object.

DIM

Dimension along which the operation is condcuted.

Description

nanmedian for financial times series objects is based on the Statistics Toolbox function nanmedian. See nanmedian in the Statistics Toolbox documentation.

m = nanmedian(X) returns the sample median of a financial time series object X, treating NaNs as missing values. m is a row vector containing the median value of non-NaN elements in each column.

m = nanmedian(X,DIM) takes the median along the dimension DIM of X.

Examples

To compute nanmedian for the following dates:

dates = {'01-Jan-2007';'02-Jan-2007';'03-Jan-2007';'04-Jan-2007'};
f = fints(dates, magic(4));
f.series1(1) = nan;
f.series2(2) = nan;
f.series3([1 3]) = nan;

nmedian = nanmedian(f)

nmedian =
    5.0000    7.0000   12.5000   10.0000

See Also

mean, nanmax, nanmin, nanstd, nansum, nanvar

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS