bfa_mixed: Initialize and fit a mixed-scale Gaussian factor model, with...

Description Usage Arguments Details Value

View source: R/main.R

Description

This function performs a specified number of MCMC iterations and returns an object containing summary statistics from the MCMC samples as well as the actual samples if keep.scores or keep.loadings are TRUE. Default behavior is to save only the loadings.

Usage

1
2
3
4
5
6
7
  bfa_mixed(x, data = NULL, num.factor = 1, restrict = NA,
  normal.dist = NA, center.data = TRUE, scale.data = TRUE,
  nsim = 0, nburn = 0, thin = 1, print.status = 500,
  keep.scores = FALSE, keep.loadings = TRUE, loading.prior
  = c("gdp", "pointmass", "normal"), factor.scales = FALSE,
  px = TRUE, coda = "loadings", coda.scale = TRUE, imh.iter
  = 500, imh.burn = 500, ...)

Arguments

x

A formula, matrix or bfa object.

data

The data if x is a formula

num.factor

Number of factors

restrict

A matrix or list giving restrictions on factor loadings. A matrix should be the same size as the loadings matrix. Acceptable values are 0 (identically 0), 1 (unrestricted), or 2 (strictly positive). List elements should be character vectors of the form c('variable',1, ">0") where 'variable' is the manifest variable, 1 is the factor, and ">0" is the restriction. Acceptable restrictions are ">0" or "0".

normal.dist

A character vector specifying which variables should be treated as observed Gaussian. Defaults to all numeric variables if x is a formula.

center.data

Center data

scale.data

Scale data

nsim

Number of iterations past burn-in

nburn

Number of initial (burn-in) iterations to discard

thin

Keep every thin'th MCMC sample (i.e. save nsim/thin samples)

print.status

How often to print status messages to console

keep.scores

Save samples of factor scores

keep.loadings

Save samples of factor loadings

loading.prior

Specify point mass ("pointmass", default) or normal priors ("normal")

factor.scales

Include a separate scale parameter for each factor

px

Use parameter expansion for ordinal variables (recommended)

coda

Create mcmc objects to allow use of functions from the coda package: "all" for loadings and scores, "loadings" or "scores" for one or the other, or "none" for neither

coda.scale

Put the loadings on the correlation scale when creating mcmc objects

imh.iter

Iterations used to build IMH proposal

imh.burn

Burn-in before collecting samples used to build IMH proposal (total burn-in is nburn+imh.iter+imh.burn)

...

Prior parameters and other (experimental) arguments (see details)

Details

Additional parameters:

Value

A bfa object with posterior samples.


bfa documentation built on May 2, 2019, 4:55 p.m.