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

Multi-level models + pymc3.glm

I need to fit a multi-level linear model using PyMC3 and I really like the glm api, because of the conciseness it provides. I would like to ask if and how this can be done. This blog post I found mentions that: glm() does not play nice with…
1
vote
0 answers

ICC per random factor for multilevel negative binomial regression

I have a multi-level negative binomial model fit with brms (library(brms)) fit1 <- brm(TOTAL_VIOLATIONS ~ LN_POP + Source_binary + Source_purchased + (1|TYPE_consolidated) + (1|COUNTY), data = Data, family = negbinomial()) This is what the data…
KDobb
  • 11
  • 3
1
vote
0 answers

Compiling Error with pymc3 and theano while running bayesian hierarchical model

I am running a bayesian hierarchical model on pymc3 and theano. When I start training my model I get this error: WARNING (theano.gof.compilelock): Overriding existing lock by dead process '16490' (I am process…
1
vote
1 answer

R - How to properly account for structural breaks in Hierarchical Bayesian VAR (BVAR)?

I am interested in using the new bvar package in R to predict a set of endogenous time series. However, because of the COVID pandemic, my time series have been through a structural break. What is the best way to account for this in the model? Some…
1
vote
0 answers

Modelling three biased coins from generated data

Here is an experiment I ran to better understand pymc3. I have three biased coins and I perform the below experiment: 1. Toss Coin1. If head choose Coin2 else choose Coin3 2. Randomly choose a number n (between 1 and 10) that implies coin tosses to…
1
vote
0 answers

How to fit a multi-level model to a large dataset with STAN?

I am making a multilevel logistic regression model in stan (using rstan) to fit to a large dataset. My dataset is a 2000 by 100100 matrix, containing simulated sequencing data of 100100 positions in the genome (SNP) of 2000 individuals. The goal of…
1
vote
0 answers

Confused about building a hierarchical Bayes model in pymc3

I am trying to build a semi-complicated PyMC3 hierarchical Bayesian model using several predictors. I think my issue is due to a lack of understanding on my part as to how to properly build these models up. I am either getting an error…
1
vote
0 answers

How to estimate general covariance of a gaussian mixture

I am trying to estimate the covariance of a 3 patches Gaussian mixture model with PyMC3. The mean and covariance are totally unknown and the weights are [1,1,1]. For the mean estimate, one can use tt.stack([vx,vy]) to build the appropriate quantity.…
sam
  • 111
  • 1
1
vote
0 answers

how to get variable values when there is per item observations

I am new to Bayesian statistics and pymc3. In my problem there is workers and reviewers. workers are given a set of questions.Responses given by workers are reviewed by the reviewers. So review is the observable variable. Based on those observes I…
Gihan Gamage
  • 2,944
  • 19
  • 27
1
vote
0 answers

How can I fix an error in the MCMChregress function that seems to stem from the R argument

I'm attempting to run a Bayesian Hierarchical model using MCMChregress, but don't know to fix the problem expressed by this error. My code is below. I believe the problem has to do with the R and r argument and how they relate to the number of…
mgsberger
  • 21
  • 4
1
vote
0 answers

Does ChoiceModelR alter the order of cases?

Im using ChoiceModelR to analyse a conjoint designe. Every participants had to answer 12 choice-sets, each consisting of 3 choice-options plus no-choice. 6 Variables described the choice-options. My imput-data for ChoiceModelR looks like this: >…
TinglTanglBob
  • 627
  • 1
  • 4
  • 14
1
vote
3 answers

Saving data from traceplot in PyMC3

Below is the code for a simple Bayesian Linear regression. After I obtain the trace and the plots for the parameters, is there any way in which I can save the data that created the plots in a file so that if I need to plot it again I can simply plot…
1
vote
0 answers

Implementing MCMC algorithm in R

Suppose I perform an experiment where the data have a $Poisson(\lambda)$ sampling density. My uncertainty about $\lambda$ using a Gamma prior density with parameters $\alpha$ and $\beta$. I also describe our uncertainty about $\alpha$ and $\beta$…
Amanda R.
  • 287
  • 1
  • 2
  • 17
1
vote
0 answers

Hierarchical Bayes with bayesm: two second-levels

Currently I am implementing a Hierarchical Bayes model with panel data for I stores with T weeks, and where my dependent variable is sales of a brand. I aim to relate store-characteristics to the explanatory variables I am using, but I wish to have…
1
vote
0 answers

stan number of effective sample size

I reproduced the results of a hierarchical model using the rethinking package with just rstan() and I am just curious why n_eff is not closer. Here is the model with random intercepts for 2 groups (intercept_x2) using the rethinking…