Zero-Inflated models in Stan

It has nothing to do with differentiability, it just puts continuous and discrete on a comparable scale. I’m not sure why the user guide talks about differentiability–maybe it’s thinking about situation where y is a parameter? Note that y as a parameter cannot work; the above requires y to be data.

It’s a typical mixture model. Keep in mind that they aren’t added together but are in different arguments to log_sum_exp.
I adapted the code from a recent post of yours since that seemed likely to be related to whatever it is you’re trying to do now.

1 Like