initParms: Initialise model parameters for 'pca_updates'

Description Usage Arguments Details Value Examples

View source: R/pca_full.R

Description

Internal function within pca_full that initialises most model parameters. WARNING: does not initialise all parameters by itself correctly (since this depends on context) and so care should be taken when using as a standalone function.

Usage

1
initParms(p, n, ncomp, verbose = TRUE)

Arguments

p

numeric – the number of variables

n

numeric – the number of observations

ncomp

numeric – the number of components/latent variables

verbose

logical – whether extra output should be displayed

Details

Random initialisations are set for the loadings and scores matrices. The mean vector is initialised to c() and set outside this function. Diagonal matrices are set for the elements of Av and Sv. V is initialised to 1 and Muv is initialised to a vector of 1s.

Value

A list of length 7:

A

matrix – initialised loadings matrix with observed variables in rows and latent variables in columns.

S

matrix – initialised factor scores matrix with latent variables in rows and observations in columns.

Mu

numeric – initialised mean vector.

V

numeric – scalar value corresponding to the initialised variance of the error parameter.

Av

array – initialised covariance matrices of the rows of A.

Sv

array – initialised covariance matrices of the rows of S.

Muv

numeric – the initialisation of the prior variance of Mu.

Examples

1
2
3
init.model <- initParms(p=10, n=10, ncomp=2, verbose = TRUE)
init.model$A
init.model$Av

HGray384/pcaNet documentation built on Nov. 14, 2020, 11:11 a.m.