1
vote
0answers
35 views

Posterior Density in R

I'm new to the site, and to Bayesian statistics and was hoping to get some help. I'm currently working through some study exercises and am required to compute the mean and variance of the posterior ...
3
votes
1answer
28 views

Calculating posterior of difference given posterior of two means

I am using R and MCMCpack to do a Bayesian analysis of some data that I have. I have generated posterior distributions (...
1
vote
1answer
40 views

Parametrization of Gamma and Negative Binomial in R

I have some Poisson data {${y_1,...,y_n}$} and a Gamma prior, and I wish to construct a predictive posterior distribution. As I understand, if my Gamma hyperparameters are $\alpha$ (the prior number ...
0
votes
0answers
22 views

Method of Composition to sample from a t density

I got stuck with this, I will appreciate a lot any help. I need to make an R program in order to run this algorithm (in the photo below), with simulated data. The question is to use the method of ...
6
votes
2answers
200 views

Bayesian analysis of contingency tables: How to describe effect size

I'm working through the examples in Kruschke's Doing Bayesian Data Analysis, specifically the Poisson exponential ANOVA in ch. 22, which he presents as an alternative to frequentist chi-square tests ...
0
votes
0answers
33 views

Are there R packages to develop spatiotemporal CAR models?

I would like to develop a spatio-temporal model with the North Carolina SIDS data set. I would use a hierachical-bayesian model as in http://www.sciencedirect.com/science/article/pii/S1572312711000098 ...
1
vote
1answer
51 views

Is this multivariate normal? 2 time series linked by a common process

Summary: Consider a scenario where you observe the inputs ($X$) to and outputs ($Y$) from a process ($B$). If I have a model describing how $X$ evolves over time, and a similar model for $Y$, how do I ...
0
votes
0answers
84 views

“Bayesian and Frequentist Regression Methods” by Jon Wakefield, a good introductory Bayesian textbook for frequentist economics graduates?

Here's a link to a good question regarding Textbooks on Bayesian statistics from some time ago. People suggested John Kruschke's "Doing Bayesian Data Analysis: A Tutorial Introduction with R and ...
3
votes
2answers
84 views

How to conditionally run element of JAGS script based on user supplied variable?

Background: I often find that when working with JAGS that I end up with a lot of JAGS scripts as I explore different models. After a while I might settle on a set of models that I'm going to report, ...
0
votes
1answer
66 views

How to interpret the output of choicemodelr (rhierMnlRwMixture) in R

Can someone help me with this one? My Problem I just started using the R library choicemodelr and succeded in getting some beta values as a solution. But I wonder ...
0
votes
0answers
41 views

Regarding three R packages for Bayesian analysis [duplicate]

There are several R packages for Bayesian analysis, i.e., RBugs, JAGS,MCMCPack. Are there ...
18
votes
5answers
480 views

What would a robust Bayesian model for estimating the scale of a roughly normal distribution be?

There exists a number of robust estimators of scale. A notable example is the median absolute deviation which relates to the standard deviation as $\sigma = \mathrm{MAD}\cdot1.4826$. In a Bayesian ...
1
vote
1answer
67 views

How to draw samples from a Bayesian nonparamatric density estimation? [DPpackage]

I am trying to compute a Kernel Density from high dimensional data ($n > 2$). The underlying (generative) model is assumed unknown. The goal is to draw samples from this estimate, in a sense ...
0
votes
0answers
39 views

Filled in observations for missing data and weights based on Bayesian technique

when dealing with missing data, filled in observations can be created for missing data and weights can be assigned to these filled in data based on Bayes theorem. I am wondering how to implement this ...
2
votes
0answers
87 views

Bayesian method to compare correlations

I have read up on Bayesian methods enough now to feel that I would rather use Bayesian analysis over Frequentist, the trouble now is finding the correct tools... I have data from an experiment with ...
0
votes
2answers
104 views

Ridge Regression in R where coefficients are penalized toward numbers other than zero

Is it possible to penalize coefficients toward a number other than zero in a ridge regression in R? For example, let's say I have dependent variable Y and independent variables X1,X2,X3, and X4. ...
0
votes
1answer
86 views

Bayesian model averaging for variable selection in R

I am trying to use Bayesian model averaging for variable selection with a large number of variables. In R, the BMS package allows to apply the method, with the option of using MCMC sampler (Metropolis ...
2
votes
2answers
193 views

How to specify/restrict the sign of coefficients in a GLM or similar model in R

The situation: I'm struggling with a predictive analysis of food sales prices using a generalized linear model. My dataset contains different kinds of food (cheeses, vegetables, meats, spices etc.) ...
2
votes
0answers
151 views

Using JAGS for bayesian parameter estimation

I am using JAGS in R to construct a probabilistic graph model and estimate the corresponding parameters. The models is described as follows: ...
2
votes
1answer
333 views

Specify a Zero-inflated (Hurdle) Gamma Model in JAGS/BUGS

I'm trying to use a zero-inflated gamma model (or a gamma 'hurdle' model). The model is a mixture of logistic regression and generalized linear modeling. I can do this analysis in two steps: 1) do a ...
4
votes
1answer
280 views

How does the beta prior affect the posterior under a binomial likelihood

I have two questions, Question 1: How can I show that the posterior distribution is a beta distribution if the likelihood is binomial and the prior is a beta Question 2: How does choices the prior ...
0
votes
0answers
42 views

Classification with Bayes Network (deal)

I am working with multiple binary vectors e.g., A,B,C,D,E,F,G,H. I want to find the classification between them. I have tried the following: ...
0
votes
1answer
138 views

Computing Bayes Factor using “Bayesfactor” package

For the purpose of model selection, I am using the Bayes' factor to compare different combinations of predictors in a linear regression model. I have used the function ...
0
votes
0answers
79 views

General Statistics Problem: Identifying trends in data

I apologize in advance if this question is overly general. I have a practical solution, which isn't very elegant, and having only a little bit of experience with statistics, am hoping for general ...
1
vote
1answer
87 views

Problems in scale Bayesian network mode using R

The problem that we have is as follows. We have close to 60 discrete random variables each of which shall take on an average of 5 categorical values. We have developed a Bayesian network ...
1
vote
0answers
88 views

The effective sample size from WinBUGS results

I am running a Bayesian regression model by WinGUBS via R2WinBUGS package in R. Everything looks fine except for one parameter: ...
3
votes
1answer
56 views

The X quantile of the difference between two RV's

To first provide some context, I have two boxplots (displaying median, 25th, and 75th percentiles), and I'm wondering what a boxplot of the difference between these two boxplots would look like. The ...
0
votes
0answers
124 views

Specifying Dirichlet prior in rjags

I am running the below mixing model using the rjags package in R, but I keep getting the error message ...
0
votes
0answers
70 views

How can one perform a multilevel ANOVA in R?

I want to apply a multilevel analysis of variance, using Bayesian framework (as was proposed by Gelman, 2005). I wish to identify the main factors to be used together in a GAM model. In this case, ...
0
votes
0answers
32 views

Type 1 error for fixed Bayesian trial

this is my R code for determining the number of successful patients needed for a clinical trial. I am trying to determine the type 1 error for the trial, can somebody give any advice or help. ...
0
votes
0answers
44 views

Adaptive Bayesian design for power calculation (type 1 error)

Can anybody give me some advice on how to incorporate power calculations into my code. I'm trying show that the operating characteristics of this adaptive Bayesian design for assumed probabilities ...
2
votes
3answers
135 views

Bayesian Vs MLE regression - getting different results

I've set up a Bayesian regression model in WinBUGS to determine values for the unknown parameters (b1, b2, b3, b4) and intercept value (b0) in a linear regression model. The code is as follows: ...
2
votes
1answer
54 views

How do I create utility scores from an unequal number of inputs

In my data I have an outcome - "daily satisfaction" - measured on a 1 to 5 scale with 5 representing the respondent was very satisfied with her day and 1 representing the respondent was very ...
3
votes
2answers
544 views

Expectation maximization on Bayesian networks with latent variables

I am trying to determine parameters in a bayesian network with two latent variables (in blue). Every variable is discrete with 2-4 categories. The latent variables have 3 categories each. I am ...
1
vote
0answers
47 views

Bayesian belief network for finding combinatory effects of multiple environmental variables on allele frequency

I'm a beginner to Bayesian belief network (BBN). I read a few articles on introduction to BBN. So I know a general idea of BBN. But I'm struggling to construct a graphical network and conditional ...
11
votes
1answer
300 views

Logistic regression model manipulation

I would like to understand what the following code is doing. The person who wrote the code no longer works here and it is almost completely undocumented. I was asked to investigate it by someone who ...
4
votes
0answers
254 views

Bayesian analysis with histogram prior. Why draw simulations from the posterior?

This is a beginner’s question on an exercise in Jim Albert’s “Bayesian Computation with R”. Note that while this might be homework, in my case it is not, as I am learning Bayesian methods in R because ...
0
votes
0answers
43 views

How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?

I am trying to calculate HPD for the coeficients of regression models fitted with lm or lmrob in R, pretty much in the same way that can be accomplished by the association of mcmcsamp and HPDinterval ...
1
vote
1answer
240 views

Simple cloud computing to run R + JAGS simulations

I want to simulate the frequentist properties of a Bayesian model. So, for example, I might want to fit a Bayesian model 1,000 times to 50 different configurations each of which takes about 10 seconds ...
2
votes
2answers
187 views

Where can i find a good book that teaches MCMC in R?

I am looking for a good book that will teach me MCMC in R , in particular Block Gibbs and Collapsed MCMC. Preferably with R pseudocode supplemented within the book as well. Does anyone have any ...
3
votes
1answer
402 views

Bayesian approach and least-squares approach to multivariate regression with structural design

Assume for example a trivariate Gaussian model: $$ {\boldsymbol Y}_1, \ldots, {\boldsymbol Y}_n \sim_{\text{iid}} {\cal N}_3\left({\boldsymbol \mu}, \Sigma\right) \quad (*) $$ with ${\boldsymbol \mu} ...
2
votes
1answer
259 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
2answers
126 views

What distributions could help describe my uncertainty about a probabilistic forecast?

I'm dealing with binary events and I've got people guestimating the chance that they occur. I'd like to translate someone else's guestimate into a probability distribution representing my belief ...
5
votes
1answer
162 views

How to calculate the probability of absence for a certain category of artefacts from a sample, given prior knowledge about its abundance?

In archaeology, artefacts are commonly classified in categories according to certain criteria (those may include manufacturing technique, decoration, function, chronology, etc). I am trying to ...
2
votes
2answers
207 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
1answer
157 views

Free PDF for Bayes

Is there an good book/pdf similar to Elements of Statistical Learning that's available for free, online that deals with Bayesian statistics, ideally with code for ...
6
votes
2answers
2k views

How would you do Bayesian ANOVA and regression in R?

I have a fairly simple dataset consisting of one independent variable, one dependent variable, and a categorical variable. I have plenty of experience running frequentist tests like ...
-1
votes
1answer
518 views

Bayesian analysis- Normal distribution with unknown mean and variance

Suppose we have some data points that we believe they follow $N(\mu, \sigma^2)$, and both parameters are unknown . I want to assign conjugate prior distributions on both $\mu$ and $\sigma^2$, and then ...
2
votes
0answers
169 views

Combining posterior distributions

I have 5 different posterior distributions (mcmc samples) which all estimate the same parameter beta. The 5 models are all obtained from 5 independent standardized datasets but estimate the same ...
2
votes
1answer
98 views

estimating beta parameter

I have data on 500 examinees with responses to 20 questions. Because the response is dichotomous, I use Beta(1,1) as the conjugate prior. Now I’m interested in using Beta(alpha, alpha) as the prior. ...