Learn R Programming

DrBats (version 0.1.6)

modelFit: Fit a Bayesian Latent Factor to a data set using STAN

Description

Fit a Bayesian Latent Factor to a data set using STAN

Usage

modelFit(
  model = "PLT",
  var.prior = "IG",
  prog = "stan",
  parallel = TRUE,
  Xhisto = NULL,
  nchains = 4,
  nthin = 10,
  niter = 10000,
  R = NULL
)

Arguments

model

a string indicating the type of model ("PLT", or sparse", default = "PLT")

var.prior

the family of priors to use for the variance parameters ("IG" for inverse gamma, or "cauchy")

prog

a string indicating the MCMC program to use (default = "stan")

parallel

true or false, whether or not to parelleize (done using the package "parallel")

Xhisto

matrix of simulated data (projected onto the histogram basis)

nchains

number of chains (default = 2)

nthin

the number of thinned interations (default = 1)

niter

number of iterations (default = 1e4)

R

rotation matrix of the same dimension as the number of desired latent factors

Value

stanfit, a STAN object

References

The Stan Development Team Stan Modeling Language User's Guide and Reference Manual. http://mc-stan.org/