Questions tagged [hierarchical-bayesian]

Hierarchical Bayesian models specify statistical priors on parameters and hyperpriors on the parameters of the prior distributions.

109 questions
1
vote
1 answer

rjags error Invalid vector argument to ilogit

I'd like to compare a betareg regression vs. the same regression using rjags library(betareg) d = data.frame(p= sample(c(.1,.2,.3,.4),100, replace= TRUE), id = seq(1,100,1)) # I am looking to reproduce this regression with…
user3022875
  • 8,598
  • 26
  • 103
  • 167
1
vote
0 answers

Python -- PYMC beta-binomial with shrinkage

I'm struggling with the implementation of a Bayesian Hierarchical model. Basically, I'm trying to build a model with this structure... hierarchical_model_picture I've got data for how many times individuals are able to hit a ball when it's thrown to…
1
vote
0 answers

Metropolis Hastings sampler for several parameters

I have hierarchical Bayesian model with 32 unknown parameters (alpha_1, alpha_2,..., alpha_30, mu, .sigma^2). conditional posterior distributions of mu and sigma^2 are have closed forms, but conditional posterior distributions of ( alpha_1,…
Zainab
  • 11
  • 3
0
votes
0 answers

Error in `choicemodelr()`: ! argument "directory" is missing, with no default

I hope your are well. I am estimating a hierarchical bayes choice model with ChoiceModelR. This is a long code that works perfectly except this chunck. Every time I run this chunck I get the error: Error in 'choicemodel()': ! argument "directory" is…
0
votes
0 answers

Compilation error using jagsUI: Index out of range taking subset of alpha

I am working on modeling how wind speed affects mosquito traps efectiveness. I've been struggling with assessment of model's goodnes of fit, and a collegue recommended to do bootstrapping dividing the data on training and test. I count with a…
scc27
  • 11
  • 2
0
votes
0 answers

Posterior of a categorical variable

I am new to pymc and probabilistic programming. I have a question, let's say I have a random variable x which is coming from a categorical distribution. The domain for x is (1,2,3) and I have a prior on x as (1->0.3, 2->0.2, 3->.5). Then I get a set…
0
votes
1 answer

Hierarchical varying effects model with MVN prior

What I'm trying to do I've already dealt with multivariate priors in pymc (I'm using 4.0.1), but I can't get their usage in a hierarchical model working. In my example I'm modeling a regression problem with two covariates x1, x2 and an outcome y.…
deemel
  • 1,006
  • 5
  • 17
  • 34
0
votes
0 answers

How/is it possible to obtain intermediate models using brm function in Bayesian modeling studies

I'm doing a research study about bayesian modelling in R. I'm using the brm function of brms package. Below is a part of my code where I obtain my model (chains=4, iter=2000). However I have a doubt about the functionalities of the brm function. I…
Zbranco
  • 1
  • 2
0
votes
0 answers

Calculating I2 from a Bayesian Model Network metanalysis

I am conducting a network metanalysis using both Bayesian (using JAGS run throug R with the package R2JAGS) and frequentist model and, as a form of heterogeneity, I would like to calculate I2. However, after computation, I have complete different…
0
votes
0 answers

How do I work around ragged data in my bayesian model in WINBUGS? - Coding Issue

Firstly, I am a student very new to what I am doing. I'd like to say that the model I am building is very simplistic at this stage. Please don't judge my work for what you see here as it's totally incomplete and terrible right now and I know it... I…
0
votes
0 answers

ValueError: Incompatible Elemsise input shapes in a Hierarchical Bayesian Time Series Model

I am trying to build a Bayesian hierarchical time series model to understand sales data of four stores using PyMC 5.4 in Python. All the stores have a seasonal component, that I am trying to model using a Fourier series. However, for the sake of…
0
votes
1 answer

How to set up a Half-Normal Prior in NIMBLE?

Can you give me example to write half-normal prior using Nimble package in R? For example, if I want my precision variable "tau.b" to follow a Half-Normal(0, 2.5), will it be correct if I put it as below? for (k in 1:nvar) {b[k] ~…
0
votes
1 answer

A setting to subjectively adjust random effect variance in R package glmmTMB?

From my layman understanding of frequentist hierarchical models, there is some penalty mechanism built into the likelihood function, that prevents the random effects from overfitting to the data and instead ‘shrinks’ them towards a group…
Will T-E
  • 607
  • 1
  • 7
  • 16
0
votes
1 answer

Set up half-Cauchy prior in rjags parfit

I'd like to set up half-Cauchy prior for rjags parallel fit. The prior is set in the model as: model <- function(){ ... # rho.b ~ dunif(-0.99, 0.99) tau_h ~ dt(0, 1, 1)T(0,) tau_b ~ dt(0, 1, 1)T(0,) precision_h <- 1/(pow(tau_h,2)) …
Chinyako
  • 35
  • 5
0
votes
0 answers

Convergence problems in pymc.sample using init=“advi+adapt_diag”. Can the NUTS sampler be initialized with advi and a non-standard obj_optimizer?

I wanted to use pymc.sample(…, init=“advi+adapt_diag”) to sample from a complicated posterior, but encountered convergence problems in the advi optimization similar to this post: https://discourse.pymc.io/t/convergence-problems-with-advi/1103 As in…
tocardz
  • 1
  • 3