Questions tagged [mcmc]

Markov chain Monte Carlo (MCMC) methods are a class of algorithms for sampling from a probability distribution based on constructing a Markov chain that has the desired distribution as its equilibrium distribution. The state of the chain after a number of steps is then used as a sample of the desired distribution

Source Wikipedia

493 questions
0
votes
1 answer

Is there a way to use ggs_caterpillar to compare two models on the same facet, all parameters are shared?

I can produce a caterpillar plot using ggmcmc::ggs_caterpillar with two facets each one showing a model. In this case all my parameters are shared between the models. I would like to plot them on the same facet. So I can visually compare each…
JCran
  • 375
  • 2
  • 14
0
votes
1 answer

confirmation on how to interpret MCMCglmm summary output

i want to know if post.mean is similar with estimate result that we see in glm model or different? thus pMCMC can be consider as p-value? i have not found people really explain on summary analysis usually they focus on something else. lastly, how to…
lalatina
  • 1
  • 1
0
votes
1 answer

How to fix tcrossprod error when running Mcmc in R package HMSC

When using the Hmsc package in R (https://github.com/hmsc-r/HMSC), I am getting a consistent error in some (not all) of the examples given in the vignettes as well as my own data. The error happens when running the sampleMcmc() function. I have…
0
votes
1 answer

Error: in ‘simulate’: argument "params" is missing, with no default

Hey I am learning package 'pomp' recently. And I don't know why there is such an error in my code, the source is from paper https://kingaa.github.io/pomp/vignettes/pompjss.pdf library(pomp) # state function gompertz.proc.sim <- function(x, t,…
GuoLY96
  • 25
  • 3
0
votes
1 answer

How to reconcile TFP with PyMC3 MCMC results?

While trying out TFP, I tried to sample from the posterior distribution of the conjugate normal model (known variance), that is x|mu ~ Normal(mu, 1.) mu ~ Normal(4., 2.) The tf.mcmc.RandomWalkMetropolis sampler gives different posterior compared to…
Pietro
  • 415
  • 6
  • 16
0
votes
1 answer

Hierachical Bayesian Linear Regression using PyMC3 is super slow

I am trying to write some code for implementing HBM in the case of logistic regression using the adults dataset from the UCI repository. I have already written the code, but sampling is super slow, on the order of 107s per sample, for even 64…
Cupitor
  • 11,007
  • 19
  • 65
  • 91
0
votes
0 answers

How to write R code for mcmc of a changepoint logistic model

I want to write a mcmc code for a changepoint logitic model, my model is like this: logit{p(x)}=beta0+beta1*doseA+(beta2-beta1)*(doseA-w)*I(doseA>w) +beta3*doseB+(beta4-beta3)*(doseB-v)*I(doseB>v) in which these are parameters to…
0
votes
0 answers

Fast Hamiltonian Monte Carlo Sampler with analytic gradient/mass matrix

I just started a project in which I need to sample from a high-dimensional (right now ~10^3-dimensional, but should go to ~10^6) & highly non-gaussian posterior distribution via a Hamiltonian Monte Carlo (HMC) sampler. In my specific case the…
user6566791
  • 75
  • 1
  • 6
0
votes
1 answer

Compute Markov Chain by given stationary vector

I'm doing homework in Monte Carlo course and I'm asked to find a matrix of Markov chain with 6 states namely 0, 1, 2, 3, 4, 5 such that after long enough period of time we have spent time proportional to the numbers 5, 10, 5, 10, 25, 60 in each of…
Zarrie
  • 325
  • 2
  • 16
0
votes
0 answers

Sample from pdf for discrete r.v

I have a random variable that can take 4 different values (4,8,16,32)and I would like to update it via sampling from its pdf, which is proportional to: \begin{equation} \pi(\nu)\prod_{i=1}^N(\Gamma(\nu/2)(\nu/2)^{(\nu/2)})^{-1} \lambda_i^{(\nu/2…
Alice
  • 99
  • 6
0
votes
1 answer

Multi Threading in C++ Windows

I am using the pystan module in Windows where multithreading is not supported on Windows in the module. The pystan module is partially written in C++ and since I am trying to decrease the run time of the module, I am wondering if there is a way to…
nik jacks
  • 75
  • 1
  • 5
0
votes
0 answers

Errors in BUGS model

I'm attempting to run this BUGS model, but am running into some errors. Any help would be greatly appreciated. model { for (i in 1:n){ y[i] ~ dnorm (a[state[i]] + theta*treat[i] + b*hispanic, tau.y) } theta ~ dnorm (0, .0001) b ~…
0
votes
0 answers

MCMCglmm Function and Priors Error in R for mixed Repeated measures Model

I am trying to model some data using a MCMCglmm with outcome measure (HoNOSTotal) taken once a year over 4 years (Time) either in a treatment condition or not (BZ_ID). I am very new at this but This is what I have so far: k <-…
Emma
  • 1
  • 1
0
votes
1 answer

How to interpret posterior probability of an regression variable?

I am using the following model in WINBUGS to run a hierarchical Bayesian regression where the beta are my covariates: If I modify this model by adding the following code: # posterior probabilities of Positive beta's p.beta0 <- step( beta0 ) p.beta1…
user121
  • 849
  • 3
  • 21
  • 39
0
votes
1 answer

Run Jags - extract multiple realisations from mcmc object

I have a runjags script that generates predicted burrow density for every cell on an island. I’m looking to obtain multiple draws (around 100) from an mcmc object for every cell. My dissertation supervisor thinks I should be able to do this using…
Bong112
  • 161
  • 10