Dimensional Functions
LikelihoodBasedProfileWiseAnalysis.LHSLikelihoodBasedProfileWiseAnalysis.add_dim_samples_rows!LikelihoodBasedProfileWiseAnalysis.check_if_bounds_suppliedLikelihoodBasedProfileWiseAnalysis.dimensional_likelihood_sampleLikelihoodBasedProfileWiseAnalysis.dimensional_optimiser!LikelihoodBasedProfileWiseAnalysis.full_likelihood_sampleLikelihoodBasedProfileWiseAnalysis.set_dim_samples_row!LikelihoodBasedProfileWiseAnalysis.uniform_gridLikelihoodBasedProfileWiseAnalysis.uniform_randomLikelihoodBasedProfileWiseAnalysis.valid_points
Common Full and Dimensional Likelihood
LikelihoodBasedProfileWiseAnalysis.add_dim_samples_rows! — Functionadd_dim_samples_rows!(model::LikelihoodModel, num_rows_to_add::Int)Adds num_rows_to_add free rows to model.dim_samples_df by vertically concatenating the existing DataFrame and free rows using LikelihoodBasedProfileWiseAnalysis.init_dim_samples_df.
LikelihoodBasedProfileWiseAnalysis.set_dim_samples_row! — Functionset_dim_samples_row!(model::LikelihoodModel,
row_ind::Int,
θindices::Vector{Int},
not_evaluated_predictions::Bool,
confidence_level::Float64,
sample_type::AbstractSampleType,
num_points::Int)Sets the relevant fields of row row_ind in model.dim_samples_df after a profile has been evaluated.
LikelihoodBasedProfileWiseAnalysis.valid_points — Functionvalid_points(model::LikelihoodModel,
grid::Matrix{Float64},
grid_size::Int,
confidence_level::Float64,
num_dims::Int,
use_threads::Bool,
use_distributed::Bool,
channel::RemoteChannel)Given a grid of grid_size points in full parameter space with num_dims dimensions, this function evaluates the log-likelihood function at each point and returns the points that are within the confidence_level log-likelihood threshold as a num_dims * n array, alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
valid_points(model::LikelihoodModel,
p::NamedTuple,
grid::Matrix{Float64},
grid_size::Int,
confidence_level::Float64,
dof::Int,
num_dims::Int,
use_threads::Bool,
channel::RemoteChannel)Given a grid of grid_size points in interest parameter space with num_dims dimensions, this function finds the values of nuisance parameters that maximise the log-likelihood function at each point and returns the points that are within the confidence_level, dof, log-likelihood threshold as a num_dims * n array, alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
LikelihoodBasedProfileWiseAnalysis.check_if_bounds_supplied — Functioncheck_if_bounds_supplied(model::LikelihoodModel,
lb::AbstractVector{<:Real},
ub::AbstractVector{<:Real})Returns the model bounds on full parameter space if lb and ub are empty, and lb and ub otherwise.
check_if_bounds_supplied(model::LikelihoodModel,
lb::AbstractVector{<:Real},
ub::AbstractVector{<:Real})Returns the model bounds on interest parameter space if lb and ub are empty, and lb and ub for interest parameter indices otherwise.
LikelihoodBasedProfileWiseAnalysis.uniform_grid — Functionuniform_grid(model::LikelihoodModel,
points_per_dimension::Union{Int, Vector{Int}},
confidence_level::Float64,
lb::AbstractVector{<:Real}=Float64[],
ub::AbstractVector{<:Real}=Float64[];
use_threads::Bool=true,
use_distributed::Bool=false,
arguments_checked::Bool=false,
channel::RemoteChannel=RemoteChannel(() -> Channel{Bool}(Inf)))Creates a uniform grid with points_per_dimension in each dimension, uniformly spaced between lb and ub if supplied or between the bounds contained in model.core.The log-likelihood function is evaluated at each grid point and all grid points within the confidence_level log-likelihood threshold are saved as a SampledConfidenceStruct. Points are saved alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
For the UniformGridSamples sample type.
uniform_grid(model::LikelihoodModel,
θindices::Vector{Int},
points_per_dimension::Union{Int, Vector{Int}},
confidence_level::Float64,
dof::Int,
lb::AbstractVector{<:Real}=Float64[],
ub::AbstractVector{<:Real}=Float64[],
θlb_nuisance::AbstractVector{<:Real}=model.core.θlb,
θub_nuisance::AbstractVector{<:Real}=model.core.θub,
optimizationsettings::OptimizationSettings=default_OptimizationSettings();
use_threads=true,
arguments_checked::Bool=false,
channel::RemoteChannel=RemoteChannel(() -> Channel{Bool}(Inf)))Creates a uniform grid on interest parameter space θindices with points_per_dimension in each interest dimension, uniformly spaced between lb[θindices] and ub[θindices] if supplied or between the bounds contained in model.core. The grid is then passed to LikelihoodBasedProfileWiseAnalysis.valid_points to determine the values of nuisance parameters that maximise log-likelihood function at each grid point. All grid points within the confidence_level log-likelihood threshold are then saved as a SampledConfidenceStruct. Points are saved alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
For the UniformGridSamples sample type.
LikelihoodBasedProfileWiseAnalysis.uniform_random — Functionuniform_random(model::LikelihoodModel,
num_points::Int,
confidence_level::Float64,
lb::AbstractVector{<:Real}=Float64[],
ub::AbstractVector{<:Real}=Float64[];
use_threads::Bool=true,
use_distributed::Bool=false,
arguments_checked::Bool=false,
channel::RemoteChannel=RemoteChannel(() -> Channel{Bool}(num_points+1)))Creates a grid of num_points uniform random points sampled between lb and ub if supplied or between the bounds contained in model.core. The log-likelihood function is evaluated at each grid point and all grid points within the confidence_level log-likelihood threshold are saved as a SampledConfidenceStruct. Points are saved alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
For the UniformRandomSamples sample type.
uniform_random(model::LikelihoodModel,
num_points::Int,
confidence_level::Float64,
dof::Int,
lb::AbstractVector{<:Real}=Float64[],
ub::AbstractVector{<:Real}=Float64[],
θlb_nuisance::AbstractVector{<:Real}=model.core.θlb,
θub_nuisance::AbstractVector{<:Real}=model.core.θub,
optimizationsettings::OptimizationSettings=default_OptimizationSettings();
use_threads::Bool=true,
use_distributed::Bool=false,
arguments_checked::Bool=false,
channel::RemoteChannel=RemoteChannel(() -> Channel{Bool}(num_points+1)))Creates a grid of num_points uniform random points on interest parameter space θindices sampled between lb[θindices] and ub[θindices] if supplied or between the bounds contained in model.core. The grid is then passed to LikelihoodBasedProfileWiseAnalysis.valid_points to determine the values of nuisance parameters that maximise log-likelihood function at each grid point. All grid points within the confidence_level log-likelihood threshold are then saved as a SampledConfidenceStruct. Points are saved alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
For the UniformRandomSamples sample type.
LikelihoodBasedProfileWiseAnalysis.LHS — FunctionLHS(model::LikelihoodModel,
num_points::Int,
confidence_level::Float64,
lb::AbstractVector{<:Real}=Float64[],
ub::AbstractVector{<:Real}=Float64[];
use_threads::Bool=true,
use_distributed::Bool=false,
arguments_checked::Bool=false,
channel::RemoteChannel=RemoteChannel(() -> Channel{Bool}(num_points+1)))Creates a grid of num_points points sampled using a Latin Hypercube sampling plan between lb and ub if supplied or between the bounds contained in model.core. The log-likelihood function is evaluated at each grid point and all grid points within the confidence_level log-likelihood threshold are saved as a SampledConfidenceStruct. Points are saved alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
For the LatinHypercubeSamples sample type.
LHS(model::LikelihoodModel,
θindices::Vector{Int},
num_points::Int,
confidence_level::Float64,
dof::Int,
lb::AbstractVector{<:Real}=Float64[],
ub::AbstractVector{<:Real}=Float64[],
θlb_nuisance::AbstractVector{<:Real}=model.core.θlb,
θub_nuisance::AbstractVector{<:Real}=model.core.θub,
optimizationsettings::OptimizationSettings=default_OptimizationSettings();
use_threads::Bool=true,
arguments_checked::Bool=false,
channel::RemoteChannel=RemoteChannel(() -> Channel{Bool}(num_points+1)))Creates a grid of num_points points on interest parameter space θindices using a Latin Hypercube sampling plan between lb[θindices] and ub[θindices] if supplied or between the bounds contained in model.core. The grid is then passed to LikelihoodBasedProfileWiseAnalysis.valid_points to determine the values of nuisance parameters that maximise log-likelihood function at each grid point. All grid points within the confidence_level log-likelihood threshold are then saved as a SampledConfidenceStruct. Points are saved alongside a vector of their log-likelihood values. Log-likelihood values are standardised to 0.0 at the MLE point.
For the LatinHypercubeSamples sample type.
Full Likelihood Only
LikelihoodBasedProfileWiseAnalysis.full_likelihood_sample — Functionfull_likelihood_sample(model::LikelihoodModel,
num_points::Union{Int, Vector{Int}},
confidence_level::Float64,
sample_type::AbstractSampleType,
lb::AbstractVector{<:Real},
ub::AbstractVector{<:Real},
use_threads::Bool,
use_distributed::Bool,
channel::RemoteChannel)Calls the desired method for sampling parameter space, sample_type, and returns a SampledConfidenceStruct containing any points that were found within the confidence_level log-likelihood threshold.
Dimensional Likelihood Only
LikelihoodBasedProfileWiseAnalysis.dimensional_optimiser! — Functiondimensional_optimiser!(θs_opt::Union{Vector, SubArray},
q::NamedTuple,
options::OptimizationSettings,
targetll::Real)Given a log-likelihood function (q.consistent.loglikefunction) which is bounded in parameter space, this function finds the values of the nuisance parameters ω that optimise the function for fixed values of the interest parameters ψ (which are already in θs_opt) and returns the log-likelihood value minus the confidence boundary target threshold. The returned function value will be zero at the locations of the approximate confidence boundary for ψ. Nuisance parameter values are stored in the corresponding indices of θs_opt, modifying the array in place.
LikelihoodBasedProfileWiseAnalysis.dimensional_likelihood_sample — Functiondimensional_likelihood_sample(model::LikelihoodModel,
θindices::Vector{Int},
num_points::Union{Int, Vector{Int}},
confidence_level::Float64,
dof::Int,
sample_type::AbstractSampleType,
lb::AbstractVector{<:Real},
ub::AbstractVector{<:Real},
θlb_nuisance::AbstractVector{<:Real},
θub_nuisance::AbstractVector{<:Real},
optimizationsettings::OptimizationSettings,
use_threads::Bool,
channel::RemoteChannel)Calls the desired method for sampling interest parameter space, sample_type, and returns a SampledConfidenceStruct containing any points that were found within the confidence_level, `dof, log-likelihood threshold.