I’m trying to fit an AR1 a time-series as following:
with pm.Model() as ar1_mat1:
theta = pm.Normal('theta',mu= 0, sigma = 3.0)
tau = pm.HalfNormal('tau',sigma =1)
likelihood = pm.AR1('likelihood', k=theta, tau_e = tau, observed = y_standard.values)
trace = pm.sample(1000, tune=2000, init="advi+adapt_diag", random_seed=2,return_inferencedata=True)
poster = pm.sample_posterior_predictive(trace)
Question is, the posterior predictive samples all have the same values for likelihood (the observed data)… Is this expected or is there something i’m missing?
Standardized “y” looks like this:
and the likelihood is as follows:
{'likelihood': array([[ 0.85319392, -0.14915978, 0.82250963, ..., -0.17984407,
-0.8855829 , -0.895811 ],
[ 0.85319392, -0.14915978, 0.82250963, ..., -0.17984407,
-0.8855829 , -0.895811 ],
[ 0.85319392, -0.14915978, 0.82250963, ..., -0.17984407,
-0.8855829 , -0.895811 ],
...,
[ 0.85319392, -0.14915978, 0.82250963, ..., -0.17984407,
-0.8855829 , -0.895811 ],
[ 0.85319392, -0.14915978, 0.82250963, ..., -0.17984407,
-0.8855829 , -0.895811 ],
[ 0.85319392, -0.14915978, 0.82250963, ..., -0.17984407,
-0.8855829 , -0.895811 ]])}