User`s guide
Variance
5-507
5Variance
Purpose Compute the variance of an input or sequence of inputs.
Library Statistics
Description The Variance block computes the variance of each column in the input, or
tracks the variance of a sequence of inputs over a period of time. The
Running
variance
parameter selects between basic operation and running operation.
Basic Operation
When the Running variance check box is not selected, the block computes the
variance of each column in M-by-N input matrix
u independently at each
sample time.
y = var(u) % Equivalent MATLAB code
For convenience, length-M 1-D vector inputs and sample-based length-M row
vector inputs are both treated as M-by-1 column vectors. (A scalar input
generates a zero-valued output.)
The output at each sample time,
y, is a 1-by-N vector containing the variance
for each column in
u. For purely real or purely imaginary inputs, the variance
of the jth column is the square of the standard deviation:
where µ
j
is the mean of the jth column. For complex inputs, the output is the
total variance for each column in
u, which is the sum of the real and imaginary
variances for that column:
The frame status of the output is the same as that of the input.
Running Operation
When the Running variance check box is selected, the block tracks the
variance of each channel in a time-sequence of M-by-N inputs. For
sample-based inputs, the output is a sample-based M-by-N matrix with each
y
j
σ
j
2
u
ij
µ
j
–
2
i 1=
M
∑
M 1–
-----------------------------------==
1 jN≤≤
σ
j
2
σ
jRe,
2
σ
jIm,
2
+=