Skip to content Skip to sidebar Skip to footer

Pymc3 Generate Stochastic Variables With Array Of Parameters

In pymc3, a stochastic variable of array shape say 3 can be generated as follows y = Normal('y', mu, sigma, shape=3, observed=some_data) Now suppose that y depends on an array of

Solution 1:

I wanted a way to do the something like following

for i in range(3):
    y[i] = Normal(mu[i], sigma[i], observed=somedata[i]) 

The way to do it is to simply pass in a list of values.

y=Normal(mu, sigma, observed=somedata) 

where mu and sigma are lists


Post a Comment for "Pymc3 Generate Stochastic Variables With Array Of Parameters"