Description Usage Arguments Value Examples
View source: R/log_likelihood.R
The log likelihood is written as:
log L = ∑_{i = 1}^{n} log (μ(t_{i}) + ∑_{t_{i} - t_{j}} g(t_{i} - t_{j})) - \int_{0}^{T} μ(t_{i}) dτ - ∑_{i=1}^{n} \int_{t_{i}}^{T} g(τ - t_{i}) dτ
Therefore, the negative log likelihood is - log L.
1 2 3 4 5 6 7 8 9 10 | neg_log_likelihood(
parameters,
events,
delay = 0,
kernel,
mu_fn = mu_none,
mu_diff_fn = mu_diff_none,
mu_int_fn = mu_int_none,
print_level = 0
)
|
parameters |
Parameters of the Hawkes kernel. |
events |
Vector of event times. |
delay |
Fixed delay |
kernel |
Kernel function for Hawkes Process. |
mu_fn |
Function that returns exogenous part of Hawkes Process. |
mu_diff_fn |
Function that returns differential of exogenous part. |
mu_int_fn |
Function that returns integral of exogenous part. |
print_level |
Level at which logger will print |
Returns negative log-likelihood for optimising parameters.
1 2 3 4 5 | neg_log_likelihood(parameters = list("alpha" = 1, "delta" = 1, "delay" = 0),
events = c(0, 1.5, 6, 9), kernel = exp_kernel)
neg_log_likelihood(parameters = list("alpha" = 1, "delta" = 1, "A" = 3, "delay" = 0),
events = c(0, 2, 5, 9), kernel = ray_kernel,
mu_fn = mu_constant, mu_int_fn = mu_int_constant)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.