Learn R Programming

rbvs (version 1.0.2)

factor.model.design: Generate factor model design matrix.

Description

This function enables a quick generation of random design matrices (see details).

Usage

factor.model.design(n, p, n.factors, sigma = 1)

Arguments

n
Number of independent realisations of the factor model.
p
Number of covariates.
n.factors
Number of factors.
sigma
Standard deviation for the normal distribution (see details).

Value

n by p matrix with independent rows following factor model (see details).

Details

The elements of the matrix returned by this routine satisfy $X_{ij} = \sum_{l=1}^{K} f_{ijl} \varphi_{il} + \theta_{ij}$ with $f_{ijl}$, $\varphi_{il}$, $\theta_{ij}$, $\varepsilon_{i}$ i.i.d. $\mathcal{N}(0,(sigma)^2)$.