Bristlecone Module
Main functionality of Bristlecone, including functions to scaffold `ModelSystem`s and for model-fitting (tests and real fits).
Nested modules
| Modules | Description |
|
Wrappers for fitting functions that use `Array.Parallel` to run many analyses at once. |
Functions and values
| Function or value |
Description
|
Full Usage:
Bristlecone.bootstrap engine endCondition bootstrapCount model series
Parameters:
EstimationEngine<'date, 'timespan, 'modelTimeUnit, MeasureOne>
-
The estimation engine / fitting method
endCondition : EndCondition
-
The end condition for each model fit
bootstrapCount : int
-
Number of times to bootstrap data
model : ModelSystem<'modelTimeUnit>
-
A model system / hypothesis to fit
series : Map<ShortCode, TimeSeries<float, 'date, 'timeunit, 'timespan>>
-
Time-series to fit with model
Returns: EstimationResult<'date, 'timeunit, 'timespan> 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.
|
Full Usage:
Bristlecone.fit engine endCondition timeSeriesData model
Parameters:
EstimationEngine<'a, 'b, 'modelTimeUnit, 'u>
-
An estimation engine configured and tested for the given model.
endCondition : EndCondition
-
The condition at which optimisation should cease.
timeSeriesData : CodedMap<TimeSeries<float<'u>, 'a, 'c, 'b>>
-
Time-series dataset that contains a series for each equation in the model system.
model : ModelSystem<'modelTimeUnit>
-
A model system of equations, likelihood function, estimatible parameters, and optional measures.
Returns: EstimationResult<'a, 'c, 'b>
The result of the model-fitting procedure. If an error occurs, throws an exception.
|
Fit a time-series model to data.
|
Full Usage:
Bristlecone.forDailyModel engine
Parameters:
EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<DateTime, TimeSpan, MeasureProduct<day, MeasureOne>, 'v>
|
|
Full Usage:
Bristlecone.forMonthlyModel engine
Parameters:
EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<DateTime, TimeSpan, MeasureProduct<month, MeasureOne>, 'v>
|
|
Full Usage:
Bristlecone.mkContinuous ()
Parameters:
unit
Returns: EstimationEngine<DateTime, TimeSpan, MeasureProduct<year, MeasureOne>, 'u>
|
A basic estimation engine for ordinary differential equations, using a Nelder-Mead optimiser.
|
Full Usage:
Bristlecone.mkDiscrete ()
Parameters:
unit
Returns: EstimationEngine<DateTime, TimeSpan, MeasureProduct<year, MeasureOne>, 'u>
|
A basic estimation engine for discrete-time equations, using a Nelder-Mead optimiser.
|
Full Usage:
Bristlecone.oneStepAhead engine hypothesis preTransform timeSeries estimatedTheta
Parameters:
EstimationEngine<'date, 'a, 'modelTimeUnit, MeasureOne>
-
The exact estimation engine used for the existing model fit
hypothesis : ModelSystem<'modelTimeUnit>
-
The exact model system / hypothesis from which parameters have been already estimated
preTransform : Map<ShortCode, TimeSeries<float, 'date, 'timeunit, 'timespan>> -> CodedMap<TimeSeries<float<MeasureOne>, 'date, 'b, 'a>>
-
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<float, 'date, 'timeunit, 'timespan>>
-
The observed data to predict against.
estimatedTheta : ParameterPool
-
A parameter pool containing already estimated parameters from model fitting step
Returns: Map<ShortCode, (TimeSeries<FitValue, 'date, 'timeunit, 'timespan> * 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.
|
Full Usage:
Bristlecone.testModel engine settings model
Parameters:
EstimationEngine<'date, 'timespan, 'modelTimeUnit, 'state>
-
An estimation engine containing the method used for model-fitting.
settings : TestSettings<'state, 'date, 'yearUnit, 'timespan>
-
Test settings that define how the test will be conducted.
model : ModelSystem<'modelTimeUnit>
-
The model system to test against the estimation engine.
Returns: TestResult<'date, 'yearUnit, 'timespan, MeasureProduct<state, MeasureOne>>
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.
|
Full Usage:
Bristlecone.tryFit engine endCondition observedSeries model
Parameters:
EstimationEngine<'date, 'timespan, 'modelTimeUnit, 'stateUnit>
-
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
-
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.
observedSeries : CodedMap<TimeSeries<float<'stateUnit>, 'date, 'yearType, 'timespan>>
model : ModelSystem<'modelTimeUnit>
-
Returns: Result<EstimationResult<'date, 'yearType, 'timespan>, 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.
|
Full Usage:
Bristlecone.tryTestModel engine settings model
Parameters:
EstimationEngine<'date, 'timespan, 'modelTimeUnit, 'state>
-
settings : TestSettings<'state, 'date, 'timeunit, 'timespan>
-
model : ModelSystem<'modelTimeUnit>
-
Returns: Result<TestResult<'date, 'timeunit, 'timespan, MeasureProduct<state, MeasureOne>>, 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.
|
Full Usage:
Bristlecone.withConditioning c engine
Parameters:
Conditioning<'u>
engine : EstimationEngine<'a, 'b, 'v, 'u>
Returns: EstimationEngine<'a, 'b, 'v, 'u>
|
Choose how the start point is chosen when solving the model system
|
Full Usage:
Bristlecone.withContinuousTime t engine
Parameters:
IntegrationRoutine
engine : EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<'a, 'b, 'u, 'v>
|
Use a custom integration method
|
Full Usage:
Bristlecone.withCustomOptimisation optim engine
Parameters:
Optimiser
engine : EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<'a, 'b, 'u, 'v>
|
|
Full Usage:
Bristlecone.withGradientDescent engine
Parameters:
EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<'a, 'b, 'u, 'v>
|
|
Full Usage:
Bristlecone.withOutput out engine
Parameters:
WriteOut
-
engine : EstimationEngine<'a, 'b, 'u, 'v>
-
Returns: EstimationEngine<'a, 'b, 'u, 'v>
|
Substitute a specific logger into
|
Full Usage:
Bristlecone.withSeed seed engine
Parameters:
int
engine : EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<'a, 'b, 'u, 'v>
|
Use a mersenne twister random number generator with a specific seed.
|
Full Usage:
Bristlecone.withTimeConversion fn engine
Parameters:
ResolutionToModelUnits<'d2, 'timespan2, 'modelTimeUnit>
engine : EstimationEngine<'d, 'o1, 'o2, 'u>
Returns: EstimationEngine<'d2, 'timespan2, 'modelTimeUnit, 'u>
|
|
Full Usage:
Bristlecone.withTunedMCMC tuning engine
Parameters:
TuneStep seq
engine : EstimationEngine<'a, 'b, 'u, 'v>
Returns: EstimationEngine<'a, 'b, 'u, 'v>
|
|
bristlecone