Hi,
I am trying to vectorize my code so that I can do something like
S_ratios_hat_vector ~ normal(S_ratios_vector, sigma);
for my likelihood.
So right now, I have a chunk in my code that goes something like this:
real C_hat[N_t,4]; // Predicted pool content
real S_hat[N_t]; // Container array for SOC solution
vector[N_t] S_hat_vector; // Container vector for SOC solution
vector[N_t] S_ratios_hat_vector; // Container vector of model ratios of S solution to S_0
...
C_hat = integrate_ode_rk45(AWB_ODE, C_t0, t0, ts, theta, x_r, x_i);
S_hat = (C_hat[:,1]);
S_hat_vector = to_vector(S_hat);
S_ratios_hat_vector = S_hat_vector / x_r[1];
return S_ratios_hat_vector;
When I run this, I get the following error message:
Mismatched array dimensions.Base type mismatch. Returned expression does not match return type
LHS type = real[]; RHS type = vector
Improper return in body of function.
I am not quite sure where the type mismatch is occurring and would appreciate some clarification. Thanks.