API references
The package exports the following functions for parameters identifiability analysis, confidence intervals evaluation and results visualization.
LikelihoodProfiler.chi2_quantile
— Functionchi2_quantile(α, df=1)
Computes α quantile for Chi2 distribution with df degrees of freedom
LikelihoodProfiler.profile
— Methodprofile(plprob::PLProblem, method::AbstractProfilerMethod;
idxs::AbstractVector{<:Int} = eachindex(get_optpars(plprob)),
parallel_type::Symbol=:none, kwargs...)
Profiles the likelihood function for the given problem plprob
using the specified profiling method
.
Arguments
plprob::PLProblem{ParameterProfile}
: The profiling problem instance containing the parameters and likelihood function to be profiled.method::AbstractProfilerMethod
: The method to be used for profiling.idxs::AbstractVector{<:Int}
: Indices of the parameters to be profiled. Defaults to all parameters.parallel_type::Symbol
: Specifies the type of parallelism to be used. Defaults to:none
.maxiters::Int
: Maximum number of iterations for one branch (left and right) of the profiling process. Defaults to1e4
.verbose::Bool
: Indicates whether to display the progress of the profiling process. Defaults tofalse
.
Returns
- Returns the profiling results
PLSolution
.
Example
plprob = PLProblem(optprob, optpars, [(-10.,10.), (-5.,5.)])
method = OptimizationProfiler(optimizer = Optimization.LBFGS(), stepper = FixedStep())
sol = profile(plprob, method; idxs=[1])
LikelihoodProfiler.CICOProfiler
— TypeCICOProfiler
Confidence Intervals by Constrained Optimization (CICO) method to find the intersections of the likelihood function with the threshold. See CICOBase docs for more details. Requires using CICOBase
.
Fields
optimizer::Symbol
: The optimizer used for the optimization process. Defaults to NLopt:LN_NELDERMEAD
.scan_tol::Float64
: The tolerance for the endpoints scan. Defaults to1e-3
.
Example
profiler = CICOProfiler(optimizer = :LN_NELDERMEAD, scan_tol = 1e-3)
LikelihoodProfiler.IntegrationProfiler
— TypeIntegrationProfiler{opType, optsType, DEAlg, DEOpts}
A profiler method that uses integration of differential equations system to profile the likelihood function.
Fields
reoptimize::Bool
: Indicates whether to re-optimization after each step of theintegrator
. Defaults tofalse
.optimizer::opType
: The optimizer used for the optimization process. Defaults tonothing
.optimizer_opts::optsType
: Options for the optimizer. Defaults toNamedTuple()
.integrator::DEAlg
: The differential equation algorithm used for integration.integrator_opts::DEOpts
: Options for the differential equation solver. Defaults toNamedTuple()
.matrix_type::Symbol
: The type of matrix to be used for the Hessian approximation. Possible options are::hessian
,:identity
. Defaults to:hessian
.gamma::Float64
: Correction factor used in integration if full hessian is not computed (e.g.matrix_type = :identity
). Defaults to1.0
.
Example
using OrdinaryDiffEq
profiler = IntegrationProfiler(integrator = Tsit5(), integrator_opts = (dtmax=0.3,), matrix_type = :hessian)
LikelihoodProfiler.OptimizationProfiler
— TypeOptimizationProfiler{S, opType, optsType}
A profiler method that uses stepwise re-optimization to profile the likelihood function.
Fields
stepper::S
: The algorithm used to compute the next profile point.optimizer::opType
: The optimizer used for the optimization process.optimizer_opts::optsType
: Options for the optimizer. Defaults toNamedTuple()
.
Example
using Optimization
profiler = OptimizationProfiler(; optimizer = Optimization.LBFGS(), optimizer_opts = (reltol=1e-4,), stepper = FixedStep())
LikelihoodProfiler.PLProblem
— TypePLProblem{T,probType,P,PF,PR}
Defines a profile likelihood problem.
Mathematical Specification of a Profile Likelihood Problem:
A profile likelihood problem is defined by
- an objective function (usually negative log-likelihood function) wrapped within an
optprob::OptimizationProblem
. Consult Optimization.jl docs for details. - a set of optimal values of the parameters
optpars
that minimize the objective function.
Constructors
PLProblem(optprob, optpars, profile_range = tuple.(optprob.lb, optprob.ub);
conf_level = 0.95, df = 1, threshold = chi2_quantile(conf_level, df))
Arguments
optprob
: TheOptimizationProblem
to be solved.optpars
: Initial (optimal) values of the parameters.profile_range
: The range over which the profile likelihood is computed. Defaults totuple.(lb,ub)
of theOptimizationProblem
.
Keyword arguments
conf_level
: The confidence level for the profile likelihood. Defaults to0.95
.df
: The degrees of freedom for the profile likelihood. Defaults to1
.threshold
: The threshold for the profile likelihood. Can be set toInf
if confidence interval endpoint estimation is not required. Defaults tochi2_quantile(conf_level, df)
.
LikelihoodProfiler.PLSolution
— TypePLSolution{probType,P}
Contains the results of a profile likelihood analysis.
Fields
prob::probType
: The profile likelihood problemPLProblem
.profiles::P
: The computed profiles.elapsedTime::Float64
: The time elapsed during the computation.
Selectors
A number of selectors are available to extract information from the sol::PLSolution
object. These can be applied to each computed profile sol[i]
:
get_endpoints(sol[i])
: Returns the confidence interval (CI) endpoints, marking the intersection of the profile with thethreshold
.get_retcodes(sol[i])
: Returns the retcodes of the CI endpoints estimation.get_stats(sol[i])
: Returns the statistics of the profile computation.