Vcov: Correlation, Variance and Covariance of a Data Set

Description Usage Arguments Details Value Author(s) Examples

View source: R/Vcov.R

Description

Vcov computes the variance of a univariate data set x and the covariance or correlation between x(i) and x(i+b).

Usage

1
Vcov(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. Vcov() computes covariance between X(i) and X(i+q),where X(i) and X(i+q) are process observations obtained at times i and i + q where q =0,1,2.....bmax. The length of the output will be bmax+1. The first element in the output γ(0) will just be the variance of the dataset. The default value of bmax is 10, which means the output will be [γ(0),γ(1),.....γ(10)] where γ(q) = Cov(X(i),X(i+q))

Value

Covariance Vector [γ(0),γ(1),.....γ(bmax)] where γ(q) = Cov(Xi,Xi+q)

Author(s)

Xiulin Xie

Examples

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

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