# cumvar {#cumvar}

## Syntax {#syntax}

`cumvar(X)`

Please see [Cumulative Window Functions](../Themes/cumFunctions.md) for the parameter description and windowing logic.

## Details {#details}

Cumulatively calculate the variance of *X*.

## Examples {#examples}

```
x=[2,3,4];
cumvar(x);
// output: [,0.5,1]

m=matrix(0.15 0.08 0.03 -0.14 -0.09, 0.2 -0.12 -0.16 0.08 0.16);
m;
```

|\#0|\#1|
|---|---|
|0.15|0.2|
|0.08|-0.12|
|0.03|-0.16|
|-0.14|0.08|
|-0.09|0.16|

```
cumvar(m);
```

|\#0|\#1|
|---|---|
| | |
|0.00245|0.0512|
|0.003633333333333|0.038933333333333|
|0.015266666666667|0.0288|
|0.01433|0.02672|

Related functions: [cummax](cummax.md), [cummin](cummin.md), [cumprod](cumprod.md), [cumPositiveStreak](cumPositiveStreak.md), [cumsum](cumsum.md), [cumavg](cumavg.md), [cumstd](cumstd.md)

