I’m trying to use tuples in a model, but I’m having difficulty initializing a tuple. I’m using cmdstanpy. Here’s a minimal example. My stan model (from documentation):
generated quantities {
tuple(int, real) ab;
ab.1 = 123;
ab.2 = 12.9;
}
My code for compiling the program:
model = stan.CmdStanModel(stan_file='program.stan')
fit = model.sample(iter_sampling=1, show_console=True)
I get the error:
ValueError: Failed to get source info for Stan model 'program.stan'. Console:
Syntax error in 'program.stan', line 2, column 8 to column 11, parsing error:
-------------------------------------------------
1: generated quantities {
2: tuple(int, real) ab;
^
3: ab.1 = 123;
4: ab.2 = 12.9;
-------------------------------------------------
Ill-formed function application. Expect comma-separated list of expressions followed by ")" after "(".
Thanks in advance for any help!