Specify different prior distribution only for some variables in the variables dim

You can pass arrays for inputs. Let’s say you wanted a vector of 10 normals, all with unit standard deviation, except the last one which should have half of it.

import numpy as np
import pymc as pm

with pm.Model() as m:
  sigmas = np.ones(10)
  sigmas[-1] = 0.5
  x = pm.Normal("x", sigma=sigmas)
  ...

Does this answer your question?

1 Like