Questions tagged [hierarchical-bayesian]

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

109 questions
6
votes
1 answer

What is the meaning of bf() in brms package when we do cumulative regression analysis?

I was trying to run a Bayesian multilevel cumulative model on ordinal data and was reading the documentation of brms online. My model looks something like model <- brm(bf(y ~ Condition + (Condition|item) + (Condition|subject)), …
Hanacl_
  • 63
  • 4
6
votes
2 answers

Error: non-constant-expression cannot be narrowed from type 'npy_intp' to 'int'

I am trying to run the following model, but it fails during compilation: import numpy as np import pymc3 as pm def sample_data(G=1, K=2): # mean proportion ([0,1]) for each g p_g = np.random.beta(2, 2, size=G) # concentration around…
merv
  • 67,214
  • 13
  • 180
  • 245
5
votes
0 answers

How to indicate an observation is the larger of two sampled values?

I'm writing a JAGS script (hierarchical bayesian model) where the times of events are modelled as a race between two processes. Observations: time is the measured times of events. Model: two processes with gaussian rates - whichever process…
Sanjay Manohar
  • 6,920
  • 3
  • 35
  • 58
4
votes
1 answer

BayesianOptimization fails due to float error

I want to optimize my HPO of my lightgbm model. I used a Bayesian Optimization process to do so. Sadly my algorithm fails to converge. MRE import warnings import pandas as pd import time import numpy as np warnings.filterwarnings("ignore") import…
4
votes
1 answer

Bayesian Calibration with PyMC3, Kennedy O'Hagan

I'm quite new to probabilistic programming and pymc3... Currently, I want to implement the Kennedy-O’Hagan framework in pymc3. The setup is according to the paper of Kennedy and O'Hagan as follows: We have n observations zi of the form zi = f(xi ,…
3
votes
0 answers

brms hurdle_lognormal model: is this a correct way to convert posterior values into y-variable units and hurdle values into probabilities?

I have a zero-inflated y-variable. Could you please confirm that my solutions for converting brms hurdle lognormal posterior values into meaningful estimates as y-variable units (lognormal part) or zero probabilities (hurdle part). Model model =…
st4co4
  • 445
  • 3
  • 10
3
votes
0 answers

Error in MCMCglmm

I'm having some troubling running a mixed model in MCMCglmm. It works fine when I try to run it as a linear regression: Model.Fit = MCMCglmm(Y~X1, random = ~Cluster, data = DataSet) But I can't seem to get it to run a logistic or ordinal…
TPM
  • 131
  • 3
3
votes
1 answer

Interpretation of variables in multi-level regression with random effects

I have a dataset that looks like the one below (first 5 rows shown). CPA is an observed result from an experiment (treatment) on different advertising flights. Flights are hierarchically grouped in campaigns. campaign_uid flight_uid treatment …
2
votes
0 answers

Writing the Jeffreys prior for a vector variable in Stan?

I am trying to model the Jeffreys prior for error variance in a heteroscedastic ANOVA design in rstan. That is to say, . Is the following setting correct? target += -2 * sum(log(sigma)); where the vector variable is declared as vector[C]…
2
votes
0 answers

How to insert for loop inside pm.Deterministic() to create an array in pymc3 model?

with pm.Model() as model: w = pm.Uniform('w', 0, 1) c = pm.Uniform('c', 0, 5) b = 0.5 s = pm.Deterministic('s', pm.math.exp(-c * (w * d1 + (1-w) * d2))) s_A = np.zeros((8)) s_A = pm.Deterministic('s_A', for i in range(8) : s_A[i] =…
2
votes
0 answers

Tensorflow probability - MCMC - problems with bijectors in transition kernel?

I'm building up a mixture of models in tensorflow-probability. The joint distribution for one given model is: one_network_prior = tfd.JointDistributionNamed( model=dict( mu_g=tfb.Sigmoid( low=-1.0, high=1.0, …
2
votes
0 answers

How to code priors for a hurdle-lognormal() brms model?

I understand the prior concept in Bayesian, which is cool, but their turning into code is too hard. As much as I know, publishing without the priors isn't a good practice. I have quite large dataset, n = 5000, thus very mildly informative priors…
st4co4
  • 445
  • 3
  • 10
2
votes
0 answers

Hierarchical Linear Regression with N-dimension sample

In this example from PyMC3 (https://docs.pymc.io/notebooks/GLM-hierarchical.html) there is estimation of posterior distribution with 1 dimensional sample (samples from dataset have only one feature). # Hyperpriors for group nodes mu_a =…
Lorenzo Vannucchi
  • 359
  • 1
  • 3
  • 11
2
votes
2 answers

Hierarchical model in Tensorflow probability using JointDistributionSequential

I'm trying to understand how to implement the following model in Tensorflow probability. An angle, theta, has uniform prior probability in the range [-pi / 2, +pi / 2]; A direction-flip probability, beta, has uniform prior probability in range [0,…
tobycoleman
  • 1,664
  • 1
  • 18
  • 34
2
votes
1 answer

PYMC3 Mixture model: help understanding multiple variables model

Let's say I have a dataframe with 4 variable. I want to see if I can generate a posterior of gamma mixtures over all the variables, with the goal to find clusters for each observation. I'm guessing I will need some sort of multivariate gamma…
1
2 3 4 5 6 7 8