Open ericxtang opened 7 years ago
Not sure if this is what you are looking for. I did it this way:
with pm.Model() as model:
alpha = 1.0/count_data.mean() # Recall count_data is the
# variable that holds our txt counts
lambda_1 = pm.Exponential("lambda_1", alpha)
lambda_2 = pm.Exponential("lambda_2", alpha)
lambda_3 = pm.Exponential("lambda_3", alpha)
tau_1 = pm.DiscreteUniform("tau_1", lower=0, upper=n_count_data)
tau_2 = pm.DiscreteUniform("tau_2", lower=tau_1, upper=n_count_data)
and
with model:
idx = np.arange(n_count_data) # Index
lambda_ = pm.math.switch(tau_2 >= idx, pm.math.switch(tau_1 >= idx, lambda_1, lambda_2), lambda_3)
Which i don't really find very neat. But it seems to work.
Hi. I'm study bayseian theory... Can i see the plot code?
Hi @friedhelmvictor can you please share the code you used to plot the text message graph above? It looks pretty OK to me and it is similar to a problem I am trying to solve. Thanks, in advance. Woodquest
How to plot the result???
Yes please. How to plot the result, have you any idea? Thanks Victor
Hi,
I see there is a PyMC example using the .deterministic annotation. Is there an easy way to do this for PyMC3?
I tried this but it's incorrect.