Plots

We provide functions for plotting univariate profiles, bivariate profiles and predictions of the model trajectory and $(1-\delta)$ population reference set from evaluated parameter confidence sets (i.e. profiles).

Univariate Profiles

LikelihoodBasedProfileWiseAnalysis.plot_univariate_profilesFunction
plot_univariate_profiles(model::LikelihoodModel,
    xlim_scaler::Real=0.2,
    ylim_scaler::Real=0.2;
    θs_to_plot::Vector=Int[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    profile_types::Vector{<:AbstractProfileType}=AbstractProfileType[], 
    num_points_in_interval::Int=0,
    palette_to_use::Symbol=:Paired_6, 
    kwargs...)

Returns a vector of plots of univariate profiles contained with the model struct that meet the requirements of the univariate method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The profiles plotted are based on the specified θs_to_plot, confidence_levels, dofs and profile_types. By default, will plot all univariate profiles generated.

If num_points_in_interval is greater than 0 then get_points_in_intervals! will be called - use to obtain smoother profile plots.

xlim_scaler and ylim_scaler are used to uniformly push the xlimits and ylimits away from the location of the confidence interval - if they are zero, then the confidence interval gives the location of the xlimits and the lower of the ylimits. If they are 1 then the corresponding limits have a range 100% wider than the confidence interval.

source
LikelihoodBasedProfileWiseAnalysis.plot_univariate_profiles_comparisonFunction
plot_univariate_profiles_comparison(model::LikelihoodModel, 
    xlim_scaler::Real=0.2,
    ylim_scaler::Real=0.2;
    θs_to_plot::Vector=Int[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    profile_types::Vector{<:AbstractProfileType}=AbstractProfileType[], 
    num_points_in_interval::Int=0,
    palette_to_use::Symbol=:Paired_6,
    label_only_lines::Bool=false,
    kwargs...)

Returns a vector of comparison plots of univariate profiles contained with the model struct that meet the requirements of the univariate method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments). Comparisons are between profile_types at the same confidence_level and dof for a given parameter.

The profiles plotted are based on the specified θs_to_plot, confidence_levels, dofs and profile_types. By default, will plot all univariate profiles generated.

If num_points_in_interval is greater than 0 then get_points_in_intervals! will be called - use to obtain smoother profile plots.

If label_only_lines=true then only the vertical and horizontal MLE point and confidence threshold lines will be labelled in the legend. Otherwise, profiles will be labelled by their profile_type.

xlim_scaler and ylim_scaler are used to uniformly push the xlimits and ylimits away from the location of the confidence interval - if they are zero, then the confidence interval gives the location of the xlimits and the lower of the ylimits. If they are 1 then the corresponding limits have a range 100% wider than the confidence interval.

source

Bivariate Profiles and Samples

LikelihoodBasedProfileWiseAnalysis.plot_bivariate_profilesFunction
plot_bivariate_profiles(model::LikelihoodModel,
    xlim_scaler::Real=0.2,
    ylim_scaler::Real=0.2;
    for_dim_samples::Bool=false,
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    profile_types::Vector{<:AbstractProfileType}=AbstractProfileType[],
    methods::Vector{<:AbstractBivariateMethod}=AbstractBivariateMethod[],
    sample_types::Vector{<:AbstractSampleType}=AbstractSampleType[],
    palette_to_use::Symbol=:Paired_6,
    include_internal_points::Bool=true,
    max_internal_points::Int=1000,
    markeralpha=1.0,
    kwargs...)

Returns a vector of plots of bivariate profiles contained with the model struct that meet the requirements of the bivariate method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The profiles plotted are based on the specified θcombinations_to_plot, confidence_levels, dofs, profile_types, methods and sample_types. By default, will plot all bivariate profiles generated. If for_dim_samples=false it will plot bivariate profiles generated by an AbstractBivariateMethod. Otherwise, it will plot bivariate profiles generated by an AbstractSampleType.

If include_internal_points=true then points inside the boundary up to max_internal_points will be plotted (these are chosen randomly). Otherwise, only the boundary of the profile will be plotted. If plotting bivariate profiles from an AbstractSampleType this boundary will be estimated using LikelihoodBasedProfileWiseAnalysis.bivariate_concave_hull.

xlim_scaler and ylim_scaler are used to uniformly push the xlimits and ylimits away from the location of the confidence boundary - if they are zero, then the extrema of the confidence boundary gives the location of the xlimits and the ylimits. If they are 1 then the corresponding limits have a range 100% wider than the extrema of the confidence boundary.

source
LikelihoodBasedProfileWiseAnalysis.plot_bivariate_profiles_comparisonFunction
plot_bivariate_profiles_comparison(model::LikelihoodModel,
    xlim_scaler::Real=0.2,
    ylim_scaler::Real=0.2;
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    profile_types::Vector{<:AbstractProfileType}=AbstractProfileType[],
    methods::Vector{<:AbstractBivariateMethod}=AbstractBivariateMethod[],
    sample_types::Vector{<:AbstractSampleType}=AbstractSampleType[],
    compare_within_methods::Bool=false,
    include_dim_samples::Bool=false,
    palette_to_use::Symbol=:Paired_6, 
    markeralpha::Number=0.7,
    label_only_MLE::Bool=false,
    kwargs...)

Returns a vector of comparison plots of bivariate profiles contained with the model struct that meet the requirements of the bivariate method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments). Comparisons are between profile_types at the same confidence_level and dof for a given parameter combination; will also be within methods if compare_within_methods=true.

The profiles plotted are based on the specified θcombinations_to_plot, confidence_levels, dofs, profile_types, methods and sample_types. By default, will plot all bivariate profiles generated. If include_dim_samples=true it will also include the concave hull boundary of bivariate profiles generated by an AbstractSampleType in the comparison (using LikelihoodBasedProfileWiseAnalysis.bivariate_concave_hull).

If label_only_MLE=true, then only the MLE point will be labelled in the legend. Otherwise, profiles will be labelled by their profile_type or sample_type.

xlim_scaler and ylim_scaler are used to uniformly push the xlimits and ylimits away from the location of the confidence boundary - if they are zero, then the extrema of the confidence boundary gives the location of the xlimits and the ylimits. If they are 1 then the corresponding limits have a range 100% wider than the extrema of the confidence boundary.

source
LikelihoodBasedProfileWiseAnalysis.plot_bivariate_profiles_iterativeboundary_gifFunction
plot_bivariate_profiles_iterativeboundary_gif(model::LikelihoodModel,
    xlim_scaler::Real=0.2,
    ylim_scaler::Real=0.2;
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    profile_types::Vector{<:AbstractProfileType}=AbstractProfileType[],
    palette_to_use::Symbol=:Paired_6,
    save_as_separate_plots::Bool=false,
    markeralpha=1.0,
    save_folder=nothing,
    kwargs...)

Saves a gif of the boundary of bivariate profiles generated using IterativeBoundaryMethod in save_folder that also meet the requirements of the bivariate method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The profiles plotted are based on the specified θcombinations_to_plot, confidence_levels, dofs and profile_types.

xlim_scaler and ylim_scaler are used to uniformly push the xlimits and ylimits away from the location of the final confidence boundary - if they are zero, then the extrema of the confidence boundary gives the location of the xlimits and the ylimits. If they are 1 then the corresponding limits have a range 100% wider than the extrema of the confidence boundary.

If save_as_separate_plots=true then alongside the saved gif, each frame of the gif will also be saved as a .png.

source

Predictions

LikelihoodBasedProfileWiseAnalysis.plot_predictions_individualFunction
plot_predictions_individual(model::LikelihoodModel,
    t::AbstractVector,
    profile_dimension::Int=1;
    xlabel::String="t",
    ylabel::Union{Nothing,String,Vector{String}}=nothing,
    for_dim_samples::Bool=false,
    include_MLE::Bool=true,
    θs_to_plot::Vector=Int[],
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    θindices_to_plot::Vector=Vector{Int}[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    profile_types::Vector{<:AbstractProfileType}=[LogLikelihood()],
    methods::Vector{<:AbstractBivariateMethod}=AbstractBivariateMethod[],
    sample_types::Vector{<:AbstractSampleType}=AbstractSampleType[],
    linealpha=0.4, 
    kwargs...)

Returns a vector of plots of profile-wise predictions of the model trajectory formed from profiles with interest parameter dimension profile_dimension that meet the requirement of the relevant method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The plotted extrema are the extrema of approximate profile-wise confidence_level trajectory confidence set from each profile.

t should be the same points used to generate predictions in generate_predictions_univariate!, generate_predictions_bivariate! and generate_predictions_dim_samples!.

The profiles plotted are based on the specified θs_to_plot, θcombinations_to_plot, θs_to_plot, confidence_levels, dofs, profile_types, methods and sample_types. By default, will plot all predictions generated from profiles with profile_dimension. If for_dim_samples=true then profile-wise trajectory confidence sets will be plotted from profiles sampled using an AbstractSampleType.

linealpha is the alpha value used for plotting each individual model trajectory line contained within a profile-wise trajectory confidence set.

source
LikelihoodBasedProfileWiseAnalysis.plot_predictions_unionFunction
plot_predictions_union(model::LikelihoodModel,
    t::AbstractVector,
    profile_dimension::Int=1,
    confidence_level::Float64=0.95;
    dof::Int=profile_dimension,
    xlabel::String="t",
    ylabel::Union{Nothing,String,Vector{String}}=nothing,
    for_dim_samples::Bool=false,
    include_MLE::Bool=true,
    θs_to_plot::Vector = Int[],
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    θindices_to_plot::Vector=Vector{Int}[],
    profile_types::Vector{<:AbstractProfileType}=[LogLikelihood()],
    methods::Vector{<:AbstractBivariateMethod}=AbstractBivariateMethod[],
    sample_types::Vector{<:AbstractSampleType}=AbstractSampleType[],
    compare_to_full_sample_type::Union{Missing, AbstractSampleType}=missing,
    include_lower_confidence_levels::Bool=false,
    linealpha=0.4,
    kwargs...)

Returns a plot of the union of profile-wise predictions of the model trajectory formed from profiles with interest parameter dimension profile_dimension that meet the requirement of the relevant method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The plotted extrema are the extrema of the approximate profile-wise confidence_level trajectory confidence set.

t should be the same points used to generate predictions in generate_predictions_univariate!, generate_predictions_bivariate! and generate_predictions_dim_samples!.

The profiles plotted are based on the specified θs_to_plot, θcombinations_to_plot, θs_to_plot, confidence_levels, dofs, profile_types, methods and sample_types. By default, will plot all predictions generated from profiles with profile_dimension. If for_dim_samples=true then the profile-wise trajectory confidence set will be plotted from profiles sampled using an AbstractSampleType.

include_lower_confidence_levels is only relevant for profiles of dimension 2 evaluated using an AbstractBivariateMethod.

If compare_to_full_sample_type isa AbstractSampleType then will also plot the extrema of the trajectory confidence set from a full parameter confidence set evaluated using the specified AbstractSampleType. For example use compare_to_full_sample_type=LatinHypercubeSamples().

linealpha is the alpha value used for plotting each individual model trajectory line contained within a profile-wise trajectory confidence set.

source
LikelihoodBasedProfileWiseAnalysis.plot_realisations_individualFunction
plot_realisations_individual(model::LikelihoodModel,
    t::AbstractVector,
    profile_dimension::Int=1;
    xlabel::String="t",
    ylabel::Union{Nothing,String,Vector{String}}=nothing,
    for_dim_samples::Bool=false
    include_MLE::Bool=true,
    θs_to_plot::Vector=Int[],
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    θindices_to_plot::Vector=Vector{Int}[],
    confidence_levels::Vector{<:Float64}=Float64[],
    dofs::Vector{<:Int}=Int[],
    regions::Vector{<:Real}=Float64[],
    profile_types::Vector{<:AbstractProfileType}=[LogLikelihood()],
    methods::Vector{<:AbstractBivariateMethod}=AbstractBivariateMethod[],
    sample_types::Vector{<:AbstractSampleType}=AbstractSampleType[],
    linealpha=0.4, 
    kwargs...)

Returns a vector of plots of profile-wise predictions of the region population reference set formed from profiles with interest parameter dimension profile_dimension that meet the requirement of the relevant method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The plotted extrema are the extrema of the approximate profile-wise (region, confidence_level) reference tolerance set from each profile.

t should be the same points used to generate predictions in generate_predictions_univariate!, generate_predictions_bivariate! and generate_predictions_dim_samples!.

The profiles plotted are based on the specified θs_to_plot, θcombinations_to_plot, θs_to_plot, confidence_levels, dofs, regions, profile_types, methods and sample_types. By default, will plot all predictions generated from profiles with profile_dimension. If for_dim_samples=true then profile-wise trajectory confidence sets will be plotted from profiles sampled using an AbstractSampleType.

source
LikelihoodBasedProfileWiseAnalysis.plot_realisations_unionFunction
plot_realisations_union(model::LikelihoodModel,
    t::AbstractVector,
    profile_dimension::Int=1,
    confidence_level::Float64=0.95;
    dof::Int=profile_dimension,
    region::Real=0.95,
    xlabel::String="t",
    ylabel::Union{Nothing,String,Vector{String}}=nothing,
    for_dim_samples::Bool=false,
    include_MLE::Bool=true,
    θs_to_plot::Vector = Int[],
    θcombinations_to_plot::Vector=Tuple{Int,Int}[],
    θindices_to_plot::Vector=Vector{Int}[],
    profile_types::Vector{<:AbstractProfileType}=[LogLikelihood()],
    methods::Vector{<:AbstractBivariateMethod}=AbstractBivariateMethod[],
    sample_types::Vector{<:AbstractSampleType}=AbstractSampleType[],
    compare_to_full_sample_type::Union{Missing, AbstractSampleType}=missing,
    include_lower_confidence_levels::Bool=false,
    linealpha=0.4,
    kwargs...)

Returns a plot of the union of profile-wise predictions of the region population reference set formed from profiles with interest parameter dimension profile_dimension that meet the requirement of the relevant method of LikelihoodBasedProfileWiseAnalysis.desired_df_subset (see Keyword Arguments).

The plotted extrema are the extrema of the approximate profile-wise (region, confidence_level) reference tolerance set.

t should be the same points used to generate predictions in generate_predictions_univariate!, generate_predictions_bivariate! and generate_predictions_dim_samples!.

The profiles plotted are based on the specified θs_to_plot, θcombinations_to_plot, θs_to_plot, confidence_levels, dofs, regions, profile_types, methods and sample_types. By default, will plot all predictions generated from profiles with profile_dimension. If for_dim_samples=true then the profile-wise reference tolerancce set will be plotted from profiles sampled using an AbstractSampleType.

include_lower_confidence_levels is only relevant for profiles of dimension 2 evaluated using an AbstractBivariateMethod.

If compare_to_full_sample_type isa AbstractSampleType then will also plot the extrema of the reference tolerance set from a full parameter confidence set evaluated using the specified AbstractSampleType. For example use compare_to_full_sample_type=LatinHypercubeSamples().

source

Index