New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmdstan eigen error vs rstan informative error #731
Comments
This error seems to be triggered specifically in function calls with certain variables. For instance this gives me a reasonable error (no function): parameters {
real a;
}
transformed parameters {
vector[1] b;
b[0] = 1.0;
}
model {
a ~ std_normal();
} This also gives me a reasonable error (matrix in function): functions {
real whatever(matrix a) {
return a[0, 0];
}
}
parameters {
real a;
}
transformed parameters {
matrix[1, 1] b;
b[1, 1] = whatever(b);
}
model {
a ~ std_normal();
} And this gives me an Eigen error (row_vector does too): functions {
real whatever(vector a) {
return a[0];
}
}
parameters {
real a;
}
transformed parameters {
vector[1] b;
b[1] = whatever(b);
}
model {
a ~ std_normal();
} |
There was one attempt at fixing this: #521 But that proved to cause a performance regression. We should give this another go once the expression rework is done in /stan. |
The issue covering this is also still open: #489 We can merge the two issues I guess. |
Having a udf with a 0 index compiles fine in both rstan and cmdstan. At run time they produce different errors and I believe cmdstanr should produce a better error.
cmdstanr error
rstan error
test model
versions
The text was updated successfully, but these errors were encountered: