Learn R Programming

changepoints (version 1.1.0)

gen.cov.mat: Generate population covariance matrix with dimension p.

Description

Generate population covariance matrix with dimension p.

Usage

gen.cov.mat(p, sigma2, type)

Value

A numeric p-by-p matrix.

Arguments

p

A integer scalar of dimensionality.

sigma2

A positive numeric scalar representing the variance of each entry.

type

Specify the type of a covariance matrix: Diagonal structure ("diagonal"); Equal correlation structure ("equal"); Power decay structure ("power").

Author

Haotian Xu

Examples

Run this code
gen.cov.mat(p = 5, sigma2 = 1, type = "diagonal")

Run the code above in your browser using DataLab