Plot the profile likelihood curve for a single parameter with confidence interval bounds.
Arguments
- profile
A data frame from
profile_likelihood()or parameter name- ci_level
Confidence level for interval (default 0.95)
- mle
Optional MLE value to mark on plot
- ...
Additional arguments passed to
plot()
Examples
spec <- model_spec(
loglik_fn = function(y, mu, sigma) sum(dnorm(y, mu, sigma, log = TRUE)),
par_names = c("mu", "sigma"),
par_bounds = list(sigma = c(1e-6, Inf))
)
y <- rnorm(100, mean = 5, sd = 2)
prof <- profile_likelihood(spec, y, par = c(mu = 5, sigma = 2), which_par = "mu")
plot_profile_likelihood(prof, mle = 5)