pymc - Mixture model of a normal and constant -
i'd model distribution mixture of normal , constant 0. i couldn't find solution because in mixture examples i've found class of distribution same every category. here code illustrate i'm looking for: with pm.model() model: x_non_zero = pm.normal(...) zero_rate = pm.uniform('zero_rate', lower=0.0, upper=.0, testval=0.5) fr = pm.bernoulli('fr', p=zero_rate) x = pm.???('x', pm.switch(pm.eq(fr, 0), x_non_zero, 0), observed=data['x']) i'm interested in rate data 0 , parameters of normal when non-zero. here how data i'm modelling looks like: one option try gaussian mixture model, may think of gaussian sd=0 constant value. option use model following: with pm.model() model: mean = pm.normal('mean', mu=100, sd=10) sd = pm.halfnormal('sd', sd=10) category = pm.categorical('category', p=[0.5, 0.5], shape=len(x)) mu = pm.switch(pm.eq(category, 0), 0, mean)