Hi There,
I am trying to devleop a multiple bayesian change model according to the stan manual:
However in my stan model, as I am trying to define a matrix for log_p = rep_matrix(-log(N),N); the stan gaves me error that “No Match for available argument signature for rep_matrix”. However I checked both manual and the tutrial which they used this function. Could you help me why I give this error?
transformed parameters {
matrix[N,N] log_p;
real mu;
real sigma;
log_p = rep_matrix(-log(N),N);
for (tau in 1:N)
for(tau2 in 1:N){
for (i in 1:N) {
mu = i < tau ? (mu1 * x[i] + gamma1) :(i < tau2 ?(mu2 * x[i] + gamma2):(mu3 * x[i] + gamma3));
sigma = i < tau ? sigma1 : (i < tau2 ? sigma2:sigma3);
log_p[tau,tau2] = log_p[tau,tau2] + normal_lpdf(y[i] | mu, sigma);
}
}
}