# Parameters as a function of time

Hello folks,
I am new to PYMC3 and I am attempting to sample set of parameters of a joint posterior distribution. The models are having time varying parameters. I have attached the models

for reference. Can anyone advice me, how to sample the parameters.

Hi! In general it is challenging to take a model specification and turn it into complete code since this can be quite time consuming. After looking through some of the tutorials, do you have a partially written model for at least part of this?

Hi!
I have tried to write the code for the first model.
with pm.Model():
alpha = pm.Normal(‘alpha’, 0, 0.001)
sigma= pm.Gamma(‘sigma’, 0.01, 0.01)
d= pm.Beta(‘d’, a,b)
a= pm.Uniform(‘a’, 0, 1)
b= pm.Uniform(‘b’, 0, 1)
c= pm.Uniform(‘c’, 0, 1)
d = pm.LogitNormal(‘d’, mu=α_1+∝_2*X_t, sigma=sigma,
observed=S_t)

I am struggling to write a code for the second model. Can you please explain or suggest some tutorials
for writing the code.

The first model has a clearly defined probabilistic specification but the second one is not easy to understand. The part that’s written only specifies the joint factorization structure. Are you assuming that the distributional form of each term is the same as (1)? If so, what is the role of the variable w? Is it to be treated as a fixed parameter? Any additional context is appreciated.

Hi!
The density function of d and S are Poisson and exponential distribution. The distribution conditions of hyper parameters are time dependent.

Thanks

There’s a lot of detail here and I’d prefer to break it down piece by piece. Is there a specific subcomponent or distribution of the above model specification that you are struggling with most?

If I can make the model simpler: d and S have the same distribution. Prior assigned to the parameters!

Thanks

I apologize but I don’t quite understand precisely what you want to achieve. Are you having issues with determining the correct distribution to implement or is it the translation of the model into code that is the problem?

It is the translation of the model into code