Sean and I are trying to refactor vector views and running into the problem that the underlying code in the Stan repos is not documented so it’s not clear what it’s supposed to be doing.
Inside the stan-dev/math library, it’s possible to do this
MatrixXd y(2, 2);
normal_lpdf(y, 0, 1);
But in the language, it’s not possible to do this:
matrix y[2, 2];
...
y ~ normal(0, 1);
The particular cases we’re worrying about are
-
Should we allow the above in the language,
matrix ~ normal(matrix, matrix)
and the like? -
Should we allow
VectorView
of aMatrixXd
? That is, treating a matrix like a simple sequence? -
Should
scalar_type<vector<MatrixXd> >::type
beMatrixXd
(as it is now) ordouble
, as I would’ve expected from the naming and the fact thatscalar_type<vector<vector<double> > >::type
isdouble
.