I’ve been working through GLM-Rolling-Regression example by @twiecki and have a question about how to manage trade-offs between variance in intercept randowm walk vs. the regression itself. In the example this is hard-coded. My initial idea is to give the model a factor like so:
std_ratio = pm.Lognormal('std_ratio', mu=4.0, sd=2.0)
sigma_intercept = pm.HalfCauchy('sigma_intercept', beta=10., testval=0.1)
intercept = pm.GaussianRandomWalk('intercept', sd=sigma_intercept, shape=lendata)
regression = intercept + slope * x
sigma = pm.Deterministic('sigma', std_ratio*sigma_intercept)
likelihood = pm.Normal('y', mu=regression[:-1], sd=sigma, observed=x[1:])
Am I doing this wrong? Intuitively, I do not like for intercept to have a higher standard deviation than y…