Learn R Programming

fastcpd (version 0.16.1)

variance_mean: Variance estimation for mean change models

Description

Implement Rice estimator for variance in mean change models.

Usage

variance_mean(data)

variance.mean(data)

Value

A matrix representing the variance-covariance matrix or a numeric value representing the variance.

Arguments

data

A matrix or a data frame with data points as each row.

Examples

Run this code
if (requireNamespace("mvtnorm", quietly = TRUE)) {
  set.seed(1)
  p <- 3
  data <- rbind(
    mvtnorm::rmvnorm(300, mean = rep(0, p), sigma = diag(100, p)),
    mvtnorm::rmvnorm(400, mean = rep(50, p), sigma = diag(100, p)),
    mvtnorm::rmvnorm(300, mean = rep(2, p), sigma = diag(100, p))
  )
  (sigma <- variance.mean(data))
}

Run the code above in your browser using DataLab