I was hoping someone better at GPs than me could help out here,
but I'll give it a shot.
Also, I didn't follow all the coding of teams in transformed
data, but I'd try to make sure that's doing the right thing
by using print statements to inspect results by hand or by
precalculating in R and passing in as data.
It looks like you're allowing each team's ability to change very
drastically across time with this covariance function:
> if (team[i]==team[j])
> Sigma[i,j] <- exp(-rho_sq*pow(date_t[i]-date_t[j],2));
> else
> Sigma[i,j] <- 0;
In terms of modeling, I'd think something that provides a bit more
of a constraint on a team's performance over time would be necessary,
because you only have one match informing the ability parameter
of each team at each time.
Otherwise, it seems you might run into separability issues, because
you only have one match informing the ability at each time.
Also, why aren't you trying to estimate the inverse sqrt length scale
rho_sq as a parameter?
I suspect making a simple time series of team's ability would be
much faster and give you roughly if not exactly the same behavior.
For a team's first game:
theta[theta[i]] ~ normal(0,2);
and then for subsequent games
theta[i] ~ normal(theta[i-last[i]], 0.5);
or something like that. You could make it hierarchical
by adding a shared scale sigma for each team's first
game, and go even further by giving each team a scale
tau[k] for variation over time, with all the tau themselves
given a hierarchical prior.
It seems like it'd run much much faster and give you the same
information without having to factor matrices and use multinormals.
There are three things you can do to help get the sampler unstuck
if the model's right.
First, provide sensible initial values for parameters. If you
set each ability to 0, that would probably work, and you can
do that with a command using init=0. Second, you can set
initial stepsize lower than the default, and I'd try stepsize=0.1
and then stepsize=0.01 if that doesn't work. The target
acceptance rate parameter is adapt_delta, and it defaults to 0.8,
but you can set it higher to something like adapt_delta=0.95 or
even adapt_delta=0.99. In RStan, that's done by adding this
to your command
, init=0, control=list(stepsize=0.01, adapt_delta=0.99),
- Bob
> <E0.csv>