| choiceofK {CODEX} | R Documentation |
Determines the number of latent variables K via AIC, BIC, and deviance reduction. A pdf file containing all three plots is generated.
choiceofK(AIC, BIC, RSS, K, filename)
AIC |
vector of AIC for each K returned from |
BIC |
vector of BIC for each K returned from |
RSS |
vector of RSS for each K returned from |
K |
vector of K returned from |
filename |
Filename of the output plot of AIC and RSS |
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'.
pdf file with three plots: AIC, BIC, and percentage of variance explained versus the number of latent factors.
Yuchao Jiang yuchaoj@wharton.upenn.edu
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 = ""))