Skip to content

gilsonshimizu/ldacov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ldacov

ldacov is an R package to estimate an LDA model with covariates using MCMC algorithms.

Installation

Use the devtools package to install ldacov directly from github.

install_github("gilsonshimizu/ldacov")

Usage

library(ldacov)
#Loads simulated data set
data("sim_data")

#Model without covariates
res=gibbs.LDA(y=sim_data$y,
             ncomm=4,#Number of clusters found previously
             ngibbs=1000,
             nburn=500,
             psi=0.01,
             gamma=0.1)

plot(res$llk,type='l')

#Model with covariates
res.cov=gibbs.LDA.cov(ncomm=4,
                     ngibbs=1000,
                     nburn=500,
                     y=sim_data$y,
                     xmat=sim_data$xmat,
                     phi.prior=0.01,
                     array.lsk.init=res$array.lsk,
                     var.betas=c(10,rep(10,ncol(sim_data$xmat)-1)),
                     phi.init=res$phi,
                     estimate.phi=FALSE)

plot(res.cov$llk,type='l')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published