updateCovmat: Update covariance matrix

View source: R/utils.r

updateCovmatR Documentation

Update covariance matrix

Description

Update covariance matrix using a stable one-pass algorithm. This is much more efficient than using cov on the full data.

Usage

updateCovmat(covmat, thetaMean, theta, i)

Arguments

covmat

covariance matrix at iteration i-1. Must be numeric, symmetrical and named.

thetaMean

mean vector at iteration i-1. Must be numeric and named.

theta

vector of new value at iteration i. Must be numeric and named.

i

current iteration.

Value

A list of two elements

  • covmat update covariance matrix

  • thetaMean updated mean vector

References

http://en.wikipedia.org/wiki/Algorithms%5Ffor%5Fcalculating%5Fvariance#Covariance # nolint


sbfnk/fitR documentation built on July 18, 2023, 3:28 p.m.