Proof of concept: Binary output format for cmdstan

Aki try

parameters {
  real a_scalar;
  tuple(tuple(array[2] real, vector[2]), matrix[2, 2]) b_tuple;
  matrix[2,2] c_matrix;
}
model {
  a_scalar ~ normal(0, 1);
  b_tuple.1.1 ~ normal(0, 1);  // array sized 2
  b_tuple.1.2 ~ normal(0, 1);  // vector sized 2
  to_vector(b_tuple.2) ~ normal(0, 1); // matrix sized 2 x 2
  to_vector(c_matrix) ~ normal(0, 1);
}
generated quantities {
  tuple(real, tuple(tuple(array[2] real, vector[2]), matrix[2, 2]), matrix[2,2]) d_tuple = (a_scalar, b_tuple, c_matrix);
  complex z = b_tuple.1.1[1] + b_tuple.1.1[2] * 1i;
}

After fitting I get the warning

Warning messages:
1: In variable_dims(metadata$variables) : NAs introduced by coercion
2: In variable_dims(metadata$variables) : NAs introduced by coercion