Hi,
I have implemented the method presented on this,
Skelly et al 2011, article using STAN. the authors of the article provided R code implementing a Gibbs sampler but it is a bit slow. It takes 25 min on some small simulated example data. The STAN implementation, in here
https://gist.github.com/inti/f8b91ee7bcb98288e314, is faster and it takes a few mins to produce the same results. I compared the results an they are correct.
I need to run the model on much larger datasets, orders of magnitud larger. Running on a real sized dataset took a day and it did not finish 100 samples, so it does not look very promising.
- My question is, how could I speed up the model?
is it correct to re-write
for (i in 1:M){
|
| increment_log_prob( |
| log_mix(pi_0, |
| beta_log(p[i],a_hat,a_hat) + beta_log(e[i],1,d_hat), |
| beta_log(p[i],f ,g) + beta_log(e[i],1,h) |
| ) |
| ); |
|
|
| } |
as following?
|
| increment_log_prob( |
| log_mix(pi_0, |
| beta_log(p,a_hat,a_hat) + beta_log(e,1,d_hat), |
| beta_log(p,f ,g) + beta_log(e,1,h) |
| ) |
| ); |
|
|
|
|
if correct could it be done similarly with the second increment_log_prob statement
I tried the ADVI and it is certainly much faster, it did run on the full dataset in under one hour.
- How could I implement stochastic variational approximation on this model? I checked the example on the ADVI arXiv paper but it is not very clear to me yet how the subsampling of the data actually happens.
many thanks in advance!