I am new in STAN. I am working on temporal ETAS model, a model used for modelling earthquakes.The intensity at earthquake occurrence time t[i] is modelled as-
h(t[i]|p,c,mu)=mu+sum((p-1)*(c^(p-1))*(1/((t[i]-t[1:(i-1)]+c)^(p-1))));
where t is the time and p,c,mu are the three parameters. I am using the Rstan. I wrote the following stan code for the model:
stan_etas="
data{
int<lower=0> N;
real<lower=0> t;
}
parameters{
real<lower=0> mu;
real<lower=1.005> p;
real<lower=0> c;
}
I know that I did not specified the time as vector. Can you help me to write the likelihood in the model section? I am facing problem writing the intensity. I think the way I used to write the intensity at time t[i] in R is not the write way to do this in STAN.
A small part (containing 20 times only) of the data is as follows: dat=list(0.0000,310.1907,948.4677,1007.2617,1029.7996,1065.7343,1199.8650, 1234.6809,1298.0234,1316.0350,1381.8400,1413.4311,1546.2059,1591.1326, 1669.5084,1738.9363,1745.5503,1797.9980,1895.6705,1936.3146)