stan programming for ETAS model
<p>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-</p>

<pre><code>h(t[i]|p,c,mu)=mu+sum((p-1)*(c^(p-1))*(1/((t[i]-t[1:(i-1)]+c)^(p-1))));
</code></pre>

<p>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:</p>

<pre><code>stan_etas="
data{
  int&lt;lower=0&gt; N;
  real&lt;lower=0&gt; t;
}
parameters{
  real&lt;lower=0&gt; mu;
  real&lt;lower=1.005&gt; p;
  real&lt;lower=0&gt; c;
}
</code></pre>

<p>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. </p>

<p>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)</p>