bristlecone


Calculating Confidence Intervals

Bristlecone includes functions to calculate confidence intervals based on a profile likelihood method. Given the minimum -log likelihood, the profile likelihood method samples the parameter space around this point. The range sampled for each parameter is discovered at 95% and 68% confidence based on a chi squared distribution.

These functions are included in the Bristlecone.Optimisation.ConfidenceInterval module. An example of their use is given below:

open Bristlecone
open Bristlecone.Optimisation
open Bristlecone.Data

// fitFn = 
fun engine dataset hypothesis result ->

    // The function used to fit the model, which unless an
    // advanced scenario is usually Bristlecone.fit
    let fitFn = Bristlecone.fit

    // The number of jumps to perform in parameter space
    let n = 10000

    let ci = ConfidenceInterval.ProfileLikelihood.profile fitFn engine dataset hypothesis n result

    // Optionally, save the result
    let saveDir = "/some/save/dir"
    let subjectName = "some subject"
    let modelId = "some model hypothesis"
    Confidence.save saveDir subjectName modelId result.ResultId ci
namespace Bristlecone
Multiple items
module Bristlecone from Bristlecone

--------------------
namespace Bristlecone
namespace Bristlecone.Optimisation
namespace Bristlecone.Data
val engine : EstimationEngine.EstimationEngine<float,float>
val dataset : Map<ShortCode.ShortCode,Time.TimeSeries.TimeSeries<float>>
val hypothesis : ModelSystem.ModelSystem
val result : ModelSystem.EstimationResult
val fitFn : (EstimationEngine.EstimationEngine<float,float> -> EstimationEngine.EndCondition<float> -> Map<ShortCode.ShortCode,Time.TimeSeries.TimeSeries<float>> -> ModelSystem.ModelSystem -> ModelSystem.EstimationResult)
val fit : engine:EstimationEngine.EstimationEngine<float,float> -> endCondition:EstimationEngine.EndCondition<float> -> timeSeriesData:Map<ShortCode.ShortCode,Time.TimeSeries.TimeSeries<float>> -> model:ModelSystem.ModelSystem -> ModelSystem.EstimationResult
<summary> Fit a time-series model to data. Please note: it is strongly recommended that you test that the given `EstimationEngine` can correctly identify known parameters for your model. Refer to the `Bristlecone.testModel` function, which can be used to generate known data and complete this process. </summary>
<param name="engine">The engine encapsulates all settings that form part of the estimation method. Importantly, this includes the random number generator used for all stages of the analysis; if this is set using a fixed seed, the result will be reproducable.</param>
<param name="endCondition">You must specify a stopping condition, after which the optimisation process will cease. Bristlecone includes built-in end conditions in the `Bristlecone.Optimisation.EndConditions` module.</param>
<param name="timeSeriesData"></param>
<param name="model"></param>
<returns></returns>
val n : int
val ci : Map<ShortCode.ShortCode,ConfidenceInterval.ConfidenceInterval>
namespace Bristlecone.Optimisation.ConfidenceInterval
module ProfileLikelihood from Bristlecone.Optimisation.ConfidenceInterval
<summary> Given a maximum likelihood estimate (MLE), the profile likelihood method runs a Monte Carlo algorithm that samples around the MLE. The range for each parameter is discovered at 95% and 68% confidence based on a chi squared distribution. </summary>
val profile : fit:(EstimationEngine.EstimationEngine<float,'a> -> EstimationEngine.EndCondition<float> -> 'b -> ModelSystem.ModelSystem -> ModelSystem.EstimationResult) -> engine:EstimationEngine.EstimationEngine<float,'a> -> subject:'b -> hypothesis:ModelSystem.ModelSystem -> n:int -> result:ModelSystem.EstimationResult -> Map<ShortCode.ShortCode,ConfidenceInterval.ConfidenceInterval>
<summary> The profile likelihood method samples the likelihood space around the Maximum Likelihood Estimate </summary>
val saveDir : string
val subjectName : string
val modelId : string
module Confidence from Bristlecone.Data
val save : directory:string -> subject:string -> modelId:string -> runId:System.Guid -> result:CodedMap<ConfidenceInterval.ConfidenceInterval> -> unit
ModelSystem.EstimationResult.ResultId: System.Guid