update_all_y: Gibbs sampling for y in 'xCx' model

Description Usage Arguments Value Author(s) Examples

View source: R/fabMix.R

Description

Gibbs sampling for updating the factors y for models with same variance of errors per component.

Usage

1
update_all_y(x_data, mu, SigmaINV, Lambda, z)

Arguments

x_data

n\times p matrix with obseved data

mu

n\times p matrix of marginal means

SigmaINV

p\times p precision matrix

Lambda

p\times q matrix of factor loadings

z

Allocation vector

Value

A matrix with generated factors

Author(s)

Panagiotis Papastamoulis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library('fabMix')

n = 8                # sample size
p = 5                # number of variables
q = 2                # number of factors
K = 2                # true number of clusters

sINV_diag = 1/((1:p))    # diagonal of inverse variance of errors
set.seed(100)
syntheticDataset <- simData(sameLambda=TRUE,K.true = K, n = n, q = q, p = p, 
                        sINV_values = sINV_diag)
# use the real values as input and simulate factors
update_all_y(x_data = syntheticDataset$data, 
		mu = syntheticDataset$means, 
		SigmaINV = diag(1/diag(syntheticDataset$variance)), 
		Lambda = syntheticDataset$factorLoadings, 
		z = syntheticDataset$class)

fabMix documentation built on Feb. 20, 2020, 1:09 a.m.