I have the following bayesian regression
where I want to estimate the parameters beta which depend on the state
s=[1, 2, 3]
which are given by an array S
. y_it
is of shape 100x90
and X_it
is of shape 100x90x20
and beta
is of shape 20x1
while N=90
refers to the number of individuals, T=90
to the time increments and K=20
to the number of predictors.For the priors I stick to weakly informative priors such a standard normal distributions.
In absence of the state variable, my model would like as follows:
with pm.Model() as model:
alpha = pm.Normal(name="alpha", mu=0.0, sigma=1.0, shape=())
beta = pm.Normal(name="beta", mu=0.0, sigma=1.0, shape=K)
eps = pm.Gamma(name="eps", alpha=9.0, beta=4.0, shape=())
y_hat = pm.Deterministic(name="y_hat", var=pm.math.dot(X, beta) + alpha)
y_like = pm.Normal(name="y_like", mu=y_hat, sigma=eps, observed=y)
How can I accommodate the state variable in the model at hand?
Thank you very much!