I have a customized log likelihood function I want to define in stan. Since my data are constructed in a recurrent event model, so I can’t use `_lpdf`

or `_lpmf`

to define the likelihood function since there are multiple time to events that do not have an independent probability distribution. Nonetheless, I can write out the joint likelihood function for these multiple events.

I read through the stan manual, and it seems to me that there are two ways where I can achieve this.

```
real likelihood_log(...){
...;
return loglikelihood;
}
```

and

```
real likelihood_lp(...){
...;
return loglikelihood;
}
```

Then I can do

```
x_vector ~ likelihood(...);
```

or

```
target += likelihood_log(x_vector | ...);
target += likelihood_lp(x_vector | ...);
```

But I am wondering what is the difference between defining the customized likelihood function in the `_lp`

and `_log`

ways?

Thank you!