1

I want to do a Bayesian analysis using pymc3. One of my parameters has a Beta distribution with a=28.78, b=0.98, loc=-0.22, scale= 0.32. Does anyone know how to define a 4-parameters Beta distribution inside the pymc3 model? Something like:

with pm.Model() as model_g:
    n=pm.Beta(ā€˜n’, 28.78, 0.98, -0.22, 0.32)
H2H
  • 31
  • 5
  • Try using the definition in https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.beta.html and passing only a and b to pymc which I think are the only ones supported – OriolAbril Nov 28 '21 at 16:07

1 Answers1

0

It's a deterministic transform:

import pymc3 as pm

theta_a = 28.78
theta_b = 0.98
theta_loc = -0.22
theta_scale = 0.32

with pm.Model() as model_g:
  n_raw = pm.Beta('n_raw', theta_a, theta_b)
  n = pm.Deterministic('n', theta_scale * n_raw + theta_loc)
merv
  • 67,214
  • 13
  • 180
  • 245