<< mvblockboot Basic functions nb_days_permonth >>

Grocer >> Basic functions > nanvar

nanvar

calculate the variance over non %nan values

CALLING SEQUENCE

m=nanvar(X,dim)

PARAMETERS

Input

* X = a (n x k) real matrix

* dim = the orientation over which variance is calculated

Output

* m = a scalar or vector collecting the variance over non %nan values

DESCRIPTION

Calculates the variance over non %nan values.

EXAMPLE

X=[%nan , 1 , %nan ;...
   %nan ,  3 , 2;...
   %nan  , 5 , 4 ]
   
y=nanvar(X)
// provides y=2.5

y=nanvar(X,'r')
// provides y=[%nan,4,2]

y=nanvar(X,'c')
// provides y=[%nan;0.5;0.5]

AUTHOR

Éric Dubois 2026

Report an issue
<< mvblockboot Basic functions nb_days_permonth >>