data {
real y_mean;
}
parameters {
real y;
}
transformed parameters {
matrix[2, 2] M;
M = [[1, 2], [3, y]];
}
model {
y ~ normal(y_mean, 1);
}
With the error:
/Users/andrew/.cmdstan/cmdstan-2.31.0/stan/lib/stan_math/lib/eigen_3.3.9/Eigen/src/Core/functors/AssignmentFunctors.h:24:104: error: assigning to 'double' from incompatible type 'const stan::math::var_value<double>'
The following model fails to compile:
With the error:
Because the construction of
M
is transpiling to:Where the
std::vector<Eigen::Matrix<double, 1, -1>>
should more likely bestd::vector<Eigen::Matrix<local_scalar_t__, 1, -1>>