Questions about BUGS language for defining Bayesian models that can be run by the WinBUGS software package. It is advised to supplement your question with a reproducible BUGS example (http://stackoverflow.com/q/5963269).

learn more… | top users | synonyms

0
votes
0answers
10 views

How to load arrays with 3 dimension using R2WinBUGS? [migrated]

Since WinBUGS and R have different ways of organizing data for arrays, how should I organize the data when using R2WinBUGS so that the order is correct? Thanks!
0
votes
0answers
37 views

How many chains should we choose in multi-treatment meta-analysis using MCMC and WinBugs

I am learning to undertake multiple treatment comparison meta-analysis (aka network meta-analysis or MTM) using WinBugs. One of the specifications are choosing the number of chains to run in the MCMC ...
1
vote
1answer
102 views

WinBUGs-TImes Series Code

I am looking to get started using times series (arima) (regression) (etc) evaluating log stock returns in WinBUGs. Does anyone have a simple code to get me jump started?
1
vote
1answer
39 views

Multiplying a matrix by a scalar which has a prior distribution in OpenBUGS

So I am having a problem specifying my model in OpenBUGS. A set of vectors in a linear regression model is given a multivariate normal prior with a constant mean vector and a constant precision matrix ...
0
votes
0answers
51 views

How to use an initial posterior for recursive / sequential updating in WinBUGS

I am using WinBUGS to estimate / update the parameters of a model. The model is: $$ \begin{aligned} D(T,B,a)&= B*(a_0+a_1T+a_2T^2+a_3T^3)+error(B,T,a) \\ error &= \mathcal N(0, ...
2
votes
1answer
190 views

Logistic Regression - Bayesian Approach - Assessing Classification Precision

I have recently begun to read about bayesian statistics and I am playing around with the R2WinBUGS package. I'm trying to fit a logistic regression to the spam data (that can be found on the webpage ...
1
vote
1answer
90 views

Thinning chains in BUGS/JAGS

Hi I have a quick question about the details of running a model in JAGS and BUGS. Say I run a model with n.burnin=5000, n.iter=5000 and thin=2. Does this mean that the program will run 5,000 ...
0
votes
1answer
146 views

WinBUGS truncated normal distribution

I am estimating a stochastic frontier with a mixed model. So far the half normal distribution worked good but I need a truncated normal distribution. It does not work, and I receive the error ...
1
vote
0answers
88 views

How do I identify this trap error in WinBUGS?

I am currently working on my thesis and interested in estimating a Weibull conditional Hazard Frailty Model for recurrent event data using WinBUGS. I wrote the model but when am trying to use it with ...
2
votes
0answers
83 views

Calculate DIC from WinBUGS output

Has anyone ever tried to calculate DIC "manually" from WinBUGS output? I tried for the simplest linear model, and could get exact the same Dbar, but always a bit different Dhat. I think Dhat ...
1
vote
1answer
92 views

Variables that do not converged in winbugs

I conducted a Bayesian analysis in winbugs and then checked the convergence from the history plots. The regression coefficients look stabilized, but the variance parameters don't. I got the number of ...
1
vote
0answers
69 views

How do you code three summation functions in WinBUGS?

I recently learned how to use winbugs. I know nothing about coding and programming. My model is not included in the set of distributions that are already available in winbugs. This is a trivariate ...
2
votes
2answers
159 views

Results Difference: Frequentist vs. Bayesian

I fit a lognormal model on some data points using both frequentist and Bayesian (using a non-informative prior) approaches. However, I got different results. Here are my codes and outputs: ...
1
vote
0answers
155 views

Fitting Lognormal Distribution in WinBugs

Let's suppose that some data points follow $Lognormal(\mu,\sigma^2)$ and both parameters are unknown . My goal is to obtain the posterior distribution by assigning conjugate prior distributions on ...
0
votes
1answer
286 views

Code Problem in Lognormal Bayesian Model in JAGS/WinBUGS

I have a data set with 853 units. Below, a small sample of it: y ...
1
vote
0answers
54 views

Latent groups in Bayes net with BUGS

I'm modeling a Bayes net with OpenBUGS, and I find problems to specify some of the parameters and their priors. The aim of the model is to identify latent groups in the data from a sample of human ...
0
votes
0answers
100 views

ANOVA with uncertain values - attempt to redefine node

I'm trying to do one-way ANOVA on uncertain (latent) input value YReal[i] (each input value is not exactly known, but it is given as normal distribution with mean ...
6
votes
3answers
294 views

Winbugs and other MCMC without information for prior distribution

What happens when you don't have an idea of the parameters distribution? What approach should we use? Most of the time we aim to undersatnd if a certain variable has any influence over the ...
4
votes
2answers
165 views

First iteration in MCMC coda chain is different from initial values

I have my jags output object. In order to understand how MCMC coda chains work, I tried to see if first iteration in each MCMC chain is equal to the initial values supplied. And it is different! The ...
4
votes
1answer
109 views

Crazy divergence in mixed model - chains start well but go crazy later

I'm trying to compute a mixed model using jags (R2jags) and I got very strange divergence. The chains started so well, very well according to the results expected (also see ...
2
votes
1answer
315 views

Can I get predictions from Winbugs/OpenBUGS?

I am new to WinBUGS and OpenBUGS. I just fit a model to try an example. I was wondering whether I can get predictions generated by WinBUGS/OpenBUGS. If not, are there any convenient ways available ...
4
votes
1answer
81 views

Inferring multiple ratios and binomial proportions with missing data

I have a number of studies describing families tested for a genetic condition. For each study the following data are described: $n_p$, number of probands (the proband is the first person in a family ...
0
votes
1answer
247 views

How does “thin” setting affect the number of samples in WinBUGS?

I do not understander how "thin" setting affects the number of samples in WinBUGS. Here is my case: Case 1: In Model --> Update... -> Update Tool, I set ...
5
votes
1answer
544 views

How to get prediction for a specific variable in WinBUGS?

I am a new user of WinBUGS and have one question for your help. After running the following code, I got parameters of beta0 through ...
0
votes
1answer
333 views
-1
votes
1answer
770 views

WinBUGS error with zero values in binomial distribution: value of order of binomial <expr> must be greater than zero

It seems that WinBUGS has problems if it has only zero draws from one binomial distribution: 1. case - simple model ...