I am trying to run a Measurement error model using CmdStan’s ode_rk45
solver. The data set has T rows and 3 columns, only the first column’s data is available. But the initial condition is available for all 3 columns (this is specified as the init
vector in the data block). As I have done before with Bayesian Hierarchical Models while using rstan
with missing data, I tried the same “tweaking” here as well—using the transformed parameters
block.
But, while I am trying to do this, I am getting this error saying: “Expected non-array type after “array” declaration.”
-------------------------------------------------
51: transformed parameters {
52: array[T] vector[3] y;
53: array[T] y[1] = C;
^
54: array[T] y[2] = T_mis;
55: array[T] y[3] = I_mis;
-------------------------------------------------
Expected non-array type after "array" declaration.
make: *** [/var/folders/p6/r39tc8jj7k1023t1rk9hgtpc0000gn/T/RtmpLgFoGl/model-99e3c24fcbf.hpp] Error 1
Error: An error occured during compilation! See the message above for more information.
Here is the code blocks pertaining to the error:
data {
int<lower=1> T;
array[T] vector[1] C;
real t0;
array[T] real<lower=1> ts;
vector[3] init;
}
parameters {
array[T] vector[1] T_mis;
array[T] vector[1] I_mis;
vector<lower=0>[3] sigma;
}
transformed parameters {
array[T] vector[3] y;
array[T] y[1] = C;
array[T] y[2] = T_mis;
array[T] y[3] = I_mis;
}
Any help on how to fix this error will be highly appreciated! Thank you all in advance!