Stan speed drastically decreases when adding one extra parameter

the Stan language doesn’t let you convert a real to an int.
(see Convert real to int and elsewhere on the forums).

you’re best off passing in int data values as an array of ints, so your input data will be broken down into a matrix plus one or more int arrays.

anything that can be computed from the data alone, without reference to parameters in the model, should be done beforehand, if possible, or in the transformed data section. it would be possible to write a little helper function to concert a real value to an int - (see here: Real to Int) and calling this from transformed data wouldn’t be so bad…

cheers,
mitzi