update_cov: Update the Covariance of a dataset

Description Usage Arguments Details Value Author(s) Examples

View source: R/update_cov.R

Description

The function updates the variance and covariance γ(q) = Cov(Xi,Xi+q) of a dataset when we have a new data

Usage

1
update_cov(oldx, old_mean, old_cov, newx)

Arguments

oldx

The previous dataset

old_mean

the mean of previous dataset

old_cov

the covariance of previous dataset

newx

value of your new data

Details

update_cov() can be used to update the variance and covariance of a large data set without recalculating the whole data set to make compuation easier by a recursive formula. The function can be used to update univariate or multivariate data set.

Value

new covariance γ(q) = Cov(Xi,Xi+q)

Author(s)

Xiulin Xie

Examples

1
update_cov(c(1:13),mean(c(1:13)),Vcov(c(1:13)),14)

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