Vcovmatrix: Covariance Matrix of a Data Set

Description Usage Arguments Details Value Author(s) Examples

View source: R/Vcovmatrix.R

Description

Vcovmatrix computes the variance of a univariate data set x and the Covariance Matrix for a univariate data x

Usage

1
Vcovmatrix(x, bmax = 10)

Arguments

x

data

bmax

γ(q) = Cov(Xi,Xi+q) , the maximun value of q

Details

The input x must be a vector. Vcovmatrix() computes Covariance Matrix for a data set. The (i,j) element of the output matrix is γ(|i-j|) = Cov(X(b),X(b+|i-j|)). More specifically, the dimension of the output matrix is (bmax +1),(bmax+1), and the diagonal element (i,i) is γ(0) which is the variance of the data set. The default value of bmax is 10, which means first row of the output will be [γ(0),γ(1),.....γ(10)], and ith row of the output will be [γ(i-1),γ(i),.....γ(11-i)] where γ(q) = Cov(X(i),X(i+q))

Value

Covariance Matrix M where M(i,j)= γ(|i-j|) = Cov(X(b),X(b+|i-j|))

Author(s)

Xiulin Xie

Examples

1
Vcovmatrix(c(1:100),bmax = 9)

XiulinXie/SPCmonitor2 documentation built on Dec. 10, 2019, 12:10 a.m.