-3
votes
1answer
74 views

Bayesian Data Analysis [on hold]

I started recently studying the Bayesian Data Analysis. I installed R studio, BEST and JAGS. I ran this analysis on two groups of means (...
1
vote
1answer
30 views

Calculation of the expectation of a posterior distribution using numerical integration methods

I want to calculate the expectation of the following posterior distribution: $$E( \theta \mid {\bf u} ) = \int\limits_{ - \infty }^\infty \theta \cdot g(\theta \mid {\bf u} )\,d\theta $$ and if ...
-2
votes
1answer
27 views

How to simulate a prior for a Poisson distribution? [closed]

I would like to simulate random variates from a Poisson distribution to act as prior for a predictive model, but I fail to do it correctly. Here is my attempt: ...
1
vote
1answer
31 views

Using interaction terms in an MCMCglmm

I am using MCMCglmm models in R, with hierarchically nested data. The basic structure of the data is as follows - each dyad is a unique combination of focal/other: ...
0
votes
1answer
44 views

R Bayesian prediction of a Gaussian process

I have a Gaussian model with mean zero, variance is arbitrary constant, and correlation function $e^{-\theta(x-x')^2}$ where $\theta$ is again an arbitrary constant. I've plotted some realizations of ...
2
votes
0answers
23 views

Hypergeometric: how do I construct a credibility interval around K (population successes) in R?

I have a problem for which I believe I should use the hypergeometric distribution, but I can't figure out how to do it in R. Say I have a bag of marbles with known number ($N$) of marbles, but the ...
4
votes
2answers
204 views

MCMC packages in R

Is there an R package for MCMC that can accept my self-defined (log)likelihood function (can be done in MCMCpack) and lets the user define contraints to the ...
2
votes
0answers
55 views

Estimating parameters and latent variables in a split Poisson distribution using R and JAGS

I am trying to estimate parameters and latent variables in a split Poisson model that describes observable and unobservable counts in time assuming the split probability is $\pi$. An observable event ...
1
vote
1answer
43 views

multivariate dirichlet for multiple imputation

I dealing with 3 covariates {x1, x2, x3} all three are discrete and contain missing data. ...
7
votes
1answer
160 views

Combining data from different sources

I want to combine data from different sources. Let's say I want to estimate a chemical property (e.g. a partitioning coefficient): I have some empirical data, varying due to measurement error around ...
0
votes
0answers
83 views

recursive feature elemination in R with caret

i work with R caret software package to select the most important features from some set of data. My response is a factor of multiple classes (e.g. nominal ...
0
votes
0answers
61 views

Penalized Bayesian quantile regression with LASSO and adaptive LASSO penalty

I have some questions about penalized Bayesian quantile regression with LASSO and adaptive LASSO penalty: Would you give me a detailed outline for the formula, especially as used in Bayesian ...
0
votes
0answers
128 views

How to interpret log fold change with negative values

I am trying to use the limma package to test some data. The data can have negative values as well as positive values and I'm trying to compare between condition 1 and condition 2. Example: ...
0
votes
0answers
35 views

Joint distribution calculation of 2 variables in R

I'm trying my hands on doing Bayesian analysis. So need some guidance. I have a dataset in the following form: Will each row have a joint distribution value. How do we calculate it in R, what ...
5
votes
2answers
124 views

Fitting a simple JAGS model with RSTAN

I'm trying to fit a simple exponential model for left censored data using RSTAN to replicate something I did in JAGS. The JAGS model is: ...
0
votes
0answers
45 views

How would you validate a random walk model?

I have used a random walk model and Gibbs sampling (more specifically RJAGS) in order to obtain posterior of the state given the observations. In this case the state is the true proportion of the ...
0
votes
0answers
58 views

Using MLE in R stats4

I have been trying to estimate the MLE for my joint posterior. I'm using R and the package stats4. I have 14 parameters and two of them are $\geq 0$, which I did not know how to implement (and I was ...
0
votes
1answer
39 views

Understanding an Implementation of normal conjugate in R

I am reading a code for a Bayesian clustering method. Both prior and the likelihood are normally distributed. If I understood correctly, such cases are called "conjugate priors" My question is about ...
0
votes
1answer
95 views

Computing a Gaussian posterior from a Gaussian prior and likelihood function in R

I'm new to both R and Bayesian statistics, and I have a problem where I have a normally distributed prior that elicits a mean and standard deviation. The introduced likelihood function is also ...
1
vote
0answers
104 views

How does the sim() function in the arm package determine non-informative priors?

The arm package includes the sim() function. On its R help page it states: ...
4
votes
2answers
244 views

simulate dirichlet process in R

I am reading the paper of "Dirichlet Process Mixtures of Generalized Linear Models" authored by L. A. Hannah. If I would like to simulate the following model $$\mathcal{P}\sim ...
1
vote
0answers
48 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
73 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
94 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
43 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 ...
7
votes
2answers
326 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
65 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
54 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 ...
2
votes
1answer
203 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
134 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
187 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
42 views

Regarding three R packages for Bayesian analysis [duplicate]

There are several R packages for Bayesian analysis, i.e., RBugs, JAGS,MCMCPack. Are there ...
21
votes
6answers
618 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
88 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
46 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
100 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
154 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
151 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
441 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.) ...
3
votes
0answers
278 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: ...
3
votes
1answer
775 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
643 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
1answer
264 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 ...
1
vote
1answer
141 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
125 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
67 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
175 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 ...
2
votes
3answers
152 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
62 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 ...
5
votes
2answers
757 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 ...