For my particular case, I think the floor calculation should not have a significant effect on the gradient calculation. The index is just used to look up a value from a table which is applied as a small correction to the model value being compared to the data in the likelihood. I use the floor loop to find the right index in the table, but then I linearly interpolate between the table values, so I think the gradient should still be smooth. Also, the correction is just a local variable in the model section, so no sampled parameters are being converted to integers.
--
You received this message because you are subscribed to the Google Groups "stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
no matches for function name="mean"
arg 0 type=int[1]
available function signatures for mean:
0. mean(real[1]) : real
1. mean(vector) : real
2. mean(row vector) : real
3. mean(matrix) : real
no matches for function name="mean"
arg 0 type=int[1]
available function signatures for mean:
0. mean(real[1]) : real
1. mean(vector) : real
2. mean(row vector) : real
3. mean(matrix) : real
expression is ill formed
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/uqh1h158ntg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
template <typename T0__>
int
real_to_int_cast(const T0__& x, std::ostream* pstream__) {
return int (x);
};
Very late to this conversation, but just in case it's useful to anyone else, you could #include a custom c++ function that executes the cast - something like:template <typename T0__>
int
real_to_int_cast(const T0__& x, std::ostream* pstream__) {
return int (x);
};
This is pretty easy in rstan, using the instructions here: https://cran.r-project.org/web/packages/rstan/vignettes/external.html. I assume it should also be easy in cmdstan, though I can't actually get it to compile property myself. Not sure about pystan.