So running your notebook, here are my thoughts/debugging below:
Metropolis, bad idea for complex model
Use default sampling (with NUTS), get gradient error
Check prior, sd
in GaussianRandomWalk is likely too small, change to sd=1
Sample seems to go well (ie it ran without returning error), but get The gelman-rubin statistic is larger than 1.4 for some parameters.
warning.
check trace for all parameters, the normalizing in
adds_est = pm.Deterministic("adds", adds_star - tt.tile(adds_star.mean(axis=1), (adds_star.shape[1], 1)).T)
subs_est = pm.Deterministic("subs", subs_star - tt.tile(subs_star.mean(axis=1), (subs_star.shape[1], 1)).T)
makes the model unidentifiable, commented it out and modify the code, reran model.
still got warning, check trace and model still unidentifiable because of the subtraction/addition. Indeed the model is still over-specify (there are more parameters than needed).
I am not sure what is the best approach here, maybe check out how others model similar problem:
Hi,
I am working on a problem to predict a continuous output variable, label (possible values: [0, infinity)), given a continuous input variable, feature (possible values: [0, infinity)). Based on previous MCMC work I’ve done with emcee (http://dfm.io/emcee/current/ ), I have found that the following relationship works reasonably well:
index = feature > threshold
predicted_label[index] = scale * (feature[index] - offset) ** exponent
predicted_label[~index] = 0
With scale ~ 0.43, offset ~ 31, e…
I am currently developing a hierarchical ratings model very similar to the one here and finding it difficult to efficiently sample from the posterior of the ratings.
I am using the NUTS sampler and have tried:
1.reparameterization (the non-centered version)
turning up the target_accept parameter.
HalfNormal Prior for omega
New variables with priors.
Example Data:
[image]
Data Prep Code:
teams = np.sort(np.unique(np.concatenate([h_matches['Team 1 ID'], h_matches['Team 2 ID']])))
maps = ob…
I am currently creating a model very similar to what @sbussmann is doing in terms of a rating/skill model.
Let’s say a player’s skill is represented by a y= N(0,1) prior, I am now at the point where I want to add in a time-dependent variable where it is basically an AR(1) process: y_t = N(rho*y_t-1, sigma). Where t is a period in time. During this period, multiple matches would have been played as observed data. for example:
t
Team 1
Team 2
Winner
0
1
2
1
0
4
3
3
1
2
3
2
Thus t…