Input, numeric or complex vector or matrix. Must not be missing.
y
Input, numeric or complex vector data. If x is a matrix (not
a vector), y must be omitted. y may be omitted if x is
a vector; in this case xcov estimates the autocovariance of
x.
maxlag
Integer scalar. Maximum covariance lag. If omitted, the
default value is N-1, where N is the greater of the lengths
of x and y or, if x is a matrix, the number of rows in
x.
scale
Character string. Specifies the type of scaling applied to the
covariation vector (or matrix). matched to one of:
"none"
return the unscaled covariance, C
"biased"
return the biased average, C/N
"unbiased"
return the unbiased average, C(k)/(N-|k|)
"coeff"
return C/(covariance at lag 0)
,
where k is the lag, and N is the length of x
If omitted, the default value is "none". If y is supplied but
does not have the same length as x, scale must be "none".
Value
A list containing the following variables:
C
array of covariance estimates
lags
vector of covariance lags [-maxlag:maxlag]
The array of covariance estimates has one of the following forms:
Cross-covariance estimate if X and Y are vectors.
Autocovariance estimate if is a vector and Y is omitted.
If x is a matrix, C is a matrix containing the
cross-covariance estimates of each column with every other column. Lag
varies with the first index so that C has 2 * maxlag + 1 rows
and \(P^2\) columns where P is the number of columns in x.