Learn R Programming

Rlda (version 0.2.6)

rlda2mcmc: Conversion between rlda to mcmc object from coda package

Description

Convert rlda object to mcmc object from coda package The rlda2mcmc function create a list of two elements incluing the Theta matrix and Phi matrix in a mcmc class.

Usage

# S3 method for rlda
rlda2mcmc(object, ...)

Arguments

object

a rlda object created by rlda.binomial, rlda.bernoulli or rlda.multinomial function.

...

other arguments may be useful.

See Also

rlda.binomial, rlda.bernoulli,rlda.multinomial

Examples

Run this code
# NOT RUN {
#Load data
data(presence)
#Set seed
set.seed(9842)
#Hyperparameters for each prior distribution
gamma <-0.01
alpha0<-0.01
alpha1<-0.01
#Execute the LDA for the Binomial entry
res<-rlda.bernoulli(presence, 10, alpha0, alpha1, gamma,
                    5000, TRUE, FALSE)
#rlda2mcmc the results
listParams <- rlda2mcmc(res)
# }

Run the code above in your browser using DataLab