SLFM: SLFM2

Description Usage Arguments Value Examples

View source: R/SLFM.R

Description

Fits a one-dimensional Spherical Latent Factor Model (Circular Factor Model) on a dataset consists of binary responses

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SLFM(
  ymat,
  n_pos = 1000,
  burnin = 500,
  thin = 1,
  hyperparams = list(a = 1, b = 1/10, ccc_a = 1, ccc_b = 25, kappa_a = 1, omega_sd =
    0.1, kappa_sd = 0.5, j_epi = 0.02, i_epi = 0.02, j_leap = 5, i_leap = 5, skip = 50,
    jitter = T),
  initial_values = NULL,
  core = 2,
  cluster_seed = 1234
)

Arguments

ymat

A binary matrix containing 0 and 1 or missing values(NA)

n_pos

Number of posterior samplers to collect

burnin

Burnin/warmup period for the MCMC

thin

Thining of the posterior chain, the default is 1

hyperparams

Hyperparameters

initial_values

Initial values for input

core

Number of cpu cores to use for parallel computing

cluster_seed

Seed number for reproducibility when 2 or more cores are used.

Value

A list containing the posterior samples for each model parameter

Examples

1
2
3
data(ymat)
set.seed(2021)
posterior_chain = SLFM(ymat = ymat,n_pos=200,burnin=50,core=1)

Xingchen-Yu/SLFM2 documentation built on Feb. 5, 2021, 12:52 a.m.