Learn R Programming

brxx (version 0.1.2)

unpack: unpack: Unpack Stan output for factor analysis samples from Stan

Description

This function unpacks raw Stan samples output.

Usage

unpack(Samples, Format)

Arguments

Samples

S by theta matrix of sample parameter estimates.

Format

list formatted data file provided for Stan

Value

Returns four matrices:

1). S by Q latent score matrix, x.

2). S by Q*P loading matrix, lambda.

3). S by P mean matrix, tau.

4). S by P loading variance matrix, alpha.

Examples

Run this code
# NOT RUN {
your_data_s=standardize(your_data)
formatted_data=prep(your_data_s,nfactors=3)
out=sampling(model, data=formatted_data, iter=5000, seed=999)
res=as.matrix(out)


unpacked=unpack(Samples=res,Format=formatted_data)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab