hey,"vector[N] c = rep_vector(0,N) " (N=3). What what will return to me?

vector[N] c = rep_vector(0,N)

Also this "data { matrix[U, O] X[1]; . . . . " is allowed;

vector[N] c = rep_vector(0,N)

Will return a vector, of length N, of 0

2 Likes

I have an array dim=c(1,90,5) in R ,how do I pass this at STAN???

This is the same as:

  matrix[90,5] par[1];

For example:

arr = structure(rep(0,1*90*5),dim=c(1,90,5))

modelcode ="
data {
  real y_mean;
  matrix[90,5] arr[1];
}
parameters{
  real y;
}
model {
  y ~ normal(y_mean,1);
}
"

mod = stan(model_code = modelcode,data=list(y_mean=0,arr=arr))

2 Likes

and if I want to multiply all this arr in STAN with something I do it like arr * 6 or arr[1]*6?