factor_infinite: Runs gibbs sampler for a factor model with potentially...

Description Usage Arguments Value

View source: R/factor_infinite.R

Description

The model is as follows:

y_i = Λ η_i + ε_i

ε_i \sim N_p(0, Σ)

where Σ = diag(σ_1^2, ..., σ_p^2).

See Bhattacharya, Anirban, and David B. Dunson. 'Sparse Bayesian infinite factor models.' Biometrika (2011): 291-306.

Usage

1
2
3
4
5
6
7
8
9
factor_infinite <- function(
  Y,
  k_star,
  niter = 1000,
  a_sig = 1,
  b_sig = 1,
  rho = 3,
  a1 = 1,
  a2 = 3)

Arguments

Y

n by p matrix

k_star

number of factors to cut off at

niter

number of iterations for the gibbs sampler to run.

a_sig

shape hyper parameter for the σ^2

b_sig

shape hyper parameter for the σ^2

rho

hyper parameter

a1

hyper parameter

a2

hyper parameter

Value

sigma2

An niter x p matrix of posterior values

lambda

An niter x p x k_star array of posterior values


dcbdan/s525 documentation built on May 19, 2019, 10:48 p.m.