choiceofK: Determine the number of latent factors K.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/choiceofK.R

Description

Determines the number of latent variables K via AIC, BIC, and deviance reduction. A pdf file containing all three plots is generated.

Usage

1
choiceofK(AIC, BIC, RSS, K, filename)

Arguments

AIC

vector of AIC for each K returned from normalize

BIC

vector of BIC for each K returned from normalize

RSS

vector of RSS for each K returned from normalize

K

vector of K returned from normalize

filename

Filename of the output plot of AIC and RSS

Details

AIC: Akaike information criterion, used for model selection; BIC: Bayesian information criterion, used for model selection; RSS: residue sum of squares, used to plot scree plot and determine the 'elbow'.

Value

pdf file with three plots: AIC, BIC, and percentage of variance explained versus the number of latent factors.

Author(s)

Yuchao Jiang yuchaoj@wharton.upenn.edu

See Also

normalize, segment

Examples

1
2
3
4
5
6
7
8
AIC <- normObjDemo$AIC
BIC <- normObjDemo$BIC
RSS <- normObjDemo$RSS
K <- normObjDemo$K
projectname <- bambedObjDemo$projectname
chr <- bambedObjDemo$chr
choiceofK(AIC, BIC, RSS, K, filename = paste(projectname, "_", chr, 
    "_choiceofK", ".pdf", sep = ""))

CODEX documentation built on Nov. 8, 2020, 8:22 p.m.