Please share your Stan program and accompanying data if possible.
functions{
real customProb_log(vector x, real alpha, real beta, real miu, real sigma){
vector[num_elements(x)] prob;
real lprob;
for (i in 1:num_elements(x)){
prob[i]=(4*alpha*(1-alpha))*exp(-0.5*pow((fabs((x[i]-miu)/sigma)+(2*alpha-1)*((x[i]-miu)/sigma)),2/(1+beta)))/tgamma(1+((1+beta)/2)*pow(2,1+((1+beta)/2)));
}
lprob=sum(log(prob));
return lprob;
}
}
data{
int N;
real Y[N];
}
parameters{
real<lower=0,upper=1> alpha;
real<lower=-1,upper=1> beta;
real miu;
real<lower=0> sigma;
}
model{
for(i in 1:N)
Y~customProb(alpha, beta, miu, sigma);
}
i get this error
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
No matches for:
real[ ] ~ customProb(real, real, real, real)
Available argument signatures for customProb:
vector ~ customProb(real, real, real, real)
Real return type required for probability function.
error in 'model18e43eca1047_new' at line 24, column 40
-------------------------------------------------
22: model{
23: for(i in 1:N)
24: Y~customProb(alpha, beta, miu, sigma);
^
25: }
-------------------------------------------------
Error in stanc(filename, allow_undefined = TRUE) :
failed to parse Stan model 'new' due to the above error.
help what do i do