Learn R Programming

capr (version 0.2.0)

simu.capr: Simulate covariance matrices compatible with capr()

Description

Generates a simple synthetic dataset for CAP regression consisting of a covariance cube, design matrix, and the latent orthogonal directions used to build the covariance slices.

Usage

simu.capr(seed = 123L, n = 120L)

Value

A list with components:

S

Array of dimension \(p \times p \times n\) holding the simulated covariance matrices.

X

Design matrix of size \(n \times 2\) with an intercept and a Bernoulli covariate.

Q

Orthogonal matrix whose columns are the latent directions.

BetaMat

True coefficient matrix used to form the eigenvalues.

H

Average covariance matrix \(\frac{1}{n}\sum_i S_i\).

p, n

The dimension and sample size supplied to the generator.

Arguments

seed

Integer seed used for reproducibility.

n

Number of observations (slices) to generate.

Examples

Run this code
sim <- simu.capr(seed = 10, n = 50)
str(sim$S)

Run the code above in your browser using DataLab