When using Variable<int> to specify ranges for VariableArrays, such as for observed data, it can also be useful to use them to constrain other double variables from a particular model. Is it possible to do this?
I've tried several different ways, but haven't found a solution yet.
- The Variable.ConstrainX functions require input variables to be of the same type (and when using Variable.ConstrainTrue, the overloaded comparison operators also requires variables of the same type.)
- Variable.Copy doesn't support changing the type of a variable.
A workaround seems to be to create two sets of variables (arrays), both int and double, and set them both to equal values when observing them, and use them each where needed. However, this seems kind of hacky.
Thanks,
Andrew