Header menu logo bristlecone

Bristlecone Module

Main functionality of Bristlecone, including functions to scaffold `ModelSystem`s and for model-fitting (tests and real fits).

Nested modules

Modules Description

Parallel

Wrappers for fitting functions that use `Array.Parallel` to run many analyses at once.

Functions and values

Function or value Description

Bristlecone.bootstrap engine endCondition bootstrapCount model series

Full Usage: Bristlecone.bootstrap engine endCondition bootstrapCount model series

Parameters:
Returns: EstimationResult list A list of estimation results (one for each bootstrap) for further analysis

Repeat a model fit many times, removing a single data point at random each time.

engine : EstimationEngine<float, float>

The estimation engine / fitting method

endCondition : EndCondition<float>

The end condition for each model fit

bootstrapCount : int

Number of times to bootstrap data

model : ModelSystem

A model system / hypothesis to fit

series : CodedMap<TimeSeries<float<MeasureOne>>>

Time-series to fit with model

Returns: EstimationResult list

A list of estimation results (one for each bootstrap) for further analysis

Bristlecone.fit engine endCondition timeSeriesData model

Full Usage: Bristlecone.fit engine endCondition timeSeriesData model

Parameters:
    engine : EstimationEngine<float, float> - An estimation engine configured and tested for the given model.
    endCondition : EndCondition<float> - The condition at which optimisation should cease.
    timeSeriesData : CodedMap<TimeSeries<float>> - Time-series dataset that contains a series for each equation in the model system.
    model : ModelSystem - A model system of equations, likelihood function, estimatible parameters, and optional measures.

Returns: EstimationResult The result of the model-fitting procedure. If an error occurs, throws an exception.

Fit a time-series model to data.

engine : EstimationEngine<float, float>

An estimation engine configured and tested for the given model.

endCondition : EndCondition<float>

The condition at which optimisation should cease.

timeSeriesData : CodedMap<TimeSeries<float>>

Time-series dataset that contains a series for each equation in the model system.

model : ModelSystem

A model system of equations, likelihood function, estimatible parameters, and optional measures.

Returns: EstimationResult

The result of the model-fitting procedure. If an error occurs, throws an exception.

Bristlecone.mkContinuous

Full Usage: Bristlecone.mkContinuous

Returns: EstimationEngine<float, float>

A basic estimation engine for ordinary differential equations, using a Nelder-Mead optimiser.

Returns: EstimationEngine<float, float>

Bristlecone.mkDiscrete

Full Usage: Bristlecone.mkDiscrete

Returns: EstimationEngine<float, float>

A basic estimation engine for discrete-time equations, using a Nelder-Mead optimiser.

Returns: EstimationEngine<float, float>

Bristlecone.oneStepAhead engine hypothesis preTransform timeSeries estimatedTheta

Full Usage: Bristlecone.oneStepAhead engine hypothesis preTransform timeSeries estimatedTheta

Parameters:
    engine : EstimationEngine<float, float> - The exact estimation engine used for the existing model fit
    hypothesis : ModelSystem - The exact model system / hypothesis from which parameters have been already estimated
    preTransform : CodedMap<TimeSeries<'a>> -> CodedMap<TimeSeries<float>> - A function that may transform each shorter time-series before prediction. This may be needed, for example, if there are custom start values that need to be configured in a complex way (e.g. for derived mesaurement variables).
    timeSeries : Map<ShortCode, TimeSeries<'a>> - The observed data to predict against.
    estimatedTheta : Pool - A parameter pool containing already estimated parameters from model fitting step

Returns: CodedMap<FitSeries * NStepStatistics> A time-series for each variable containing a step-ahead prediction

Addresses the question: "How good am I at predicting the next data point?. Given fitted parameters, assesses how well the model predicts the next data point from each point in the time-series data. This approach can provide another indication of model performance.

engine : EstimationEngine<float, float>

The exact estimation engine used for the existing model fit

hypothesis : ModelSystem

The exact model system / hypothesis from which parameters have been already estimated

preTransform : CodedMap<TimeSeries<'a>> -> CodedMap<TimeSeries<float>>

A function that may transform each shorter time-series before prediction. This may be needed, for example, if there are custom start values that need to be configured in a complex way (e.g. for derived mesaurement variables).

timeSeries : Map<ShortCode, TimeSeries<'a>>

The observed data to predict against.

estimatedTheta : Pool

A parameter pool containing already estimated parameters from model fitting step

Returns: CodedMap<FitSeries * NStepStatistics>

A time-series for each variable containing a step-ahead prediction

Bristlecone.testModel engine settings model

Full Usage: Bristlecone.testModel engine settings model

Parameters:
    engine : EstimationEngine<float, float> - An estimation engine containing the method used for model-fitting.
    settings : TestSettings<float> - Test settings that define how the test will be conducted.
    model : ModelSystem - The model system to test against the estimation engine.

Returns: TestResult A test result that indicates differences between the expected and actual fit.

Test that the specified estimation engine can correctly estimate known parameters. Random parameter sets are generated from the given model system.

engine : EstimationEngine<float, float>

An estimation engine containing the method used for model-fitting.

settings : TestSettings<float>

Test settings that define how the test will be conducted.

model : ModelSystem

The model system to test against the estimation engine.

Returns: TestResult

A test result that indicates differences between the expected and actual fit.

Bristlecone.tryFit engine endCondition timeSeriesData model

Full Usage: Bristlecone.tryFit engine endCondition timeSeriesData model

Parameters:
    engine : EstimationEngine<float, float> - 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.
    endCondition : EndCondition<float> - 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.
    timeSeriesData : CodedMap<TimeSeries<float>> -
    model : ModelSystem -

Returns: Result<EstimationResult, string>

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.

engine : EstimationEngine<float, float>

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.

endCondition : EndCondition<float>

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.

timeSeriesData : CodedMap<TimeSeries<float>>

model : ModelSystem

Returns: Result<EstimationResult, string>

Bristlecone.tryTestModel engine settings model

Full Usage: Bristlecone.tryTestModel engine settings model

Parameters:
Returns: Result<TestResult, string> A test result that indicates the error structure. It is wrapped in an F# Result, indicating if the procedure was successful or not.

Tests that the specified estimation engine can correctly estimate known parameters given specfici test settings. Random parameter sets and resultant fake time-series data are generated for the model system by using the rules and noise generation settings in the stated test settings.

engine : EstimationEngine<float, float>

settings : TestSettings<float>

model : ModelSystem

Returns: Result<TestResult, string>

A test result that indicates the error structure. It is wrapped in an F# Result, indicating if the procedure was successful or not.

Bristlecone.withConditioning c engine

Full Usage: Bristlecone.withConditioning c engine

Parameters:
Returns: EstimationEngine<'a, 'b>

Choose how the start point is chosen when solving the model system

c : Conditioning<'a>
engine : EstimationEngine<'a, 'b>
Returns: EstimationEngine<'a, 'b>

Bristlecone.withContinuousTime t engine

Full Usage: Bristlecone.withContinuousTime t engine

Parameters:
Returns: EstimationEngine<'a, 'b>

Use a custom integration method

t : Integrate<'a, 'b>
engine : EstimationEngine<'a, 'b>
Returns: EstimationEngine<'a, 'b>

Bristlecone.withCustomOptimisation optim engine

Full Usage: Bristlecone.withCustomOptimisation optim engine

Parameters:
Returns: EstimationEngine<'a, 'b>
optim : Optimiser<'a>
engine : EstimationEngine<'a, 'b>
Returns: EstimationEngine<'a, 'b>

Bristlecone.withGradientDescent engine

Full Usage: Bristlecone.withGradientDescent engine

Parameters:
Returns: EstimationEngine<float, 'a>
engine : EstimationEngine<float, 'a>
Returns: EstimationEngine<float, 'a>

Bristlecone.withOutput out engine

Full Usage: Bristlecone.withOutput out engine

Parameters:
Returns: EstimationEngine<'a, 'b>

Substitute a specific logger into

out : WriteOut

engine : EstimationEngine<'a, 'b>

Returns: EstimationEngine<'a, 'b>

Bristlecone.withSeed seed engine

Full Usage: Bristlecone.withSeed seed engine

Parameters:
Returns: EstimationEngine<'a, 'b>

Use a mersenne twister random number generator with a specific seed.

seed : int
engine : EstimationEngine<'a, 'b>
Returns: EstimationEngine<'a, 'b>

Bristlecone.withTunedMCMC tuning engine

Full Usage: Bristlecone.withTunedMCMC tuning engine

Parameters:
Returns: EstimationEngine<float, 'a>
tuning : TuneStep<float> seq
engine : EstimationEngine<float, 'a>
Returns: EstimationEngine<float, 'a>

Type something to start searching.