Documentation for MultiFitter
Bases: CarbonFitter
A class for parametric inference of d14c data from a common time period using an ensemble of SingleFitter. Does parameter fitting, likelihood evaluations, Monte Carlo sampling, plotting and more.
MultiFitter = []
instance-attribute
__init__(adaptive=True)
Initializes a MultiFitter object.
add_SingleFitter(sf)
Adds a SingleFitter object to a Multifitter object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sf |
SingleFitter
|
SingleFitter Object |
required |
compile()
Prepares a Multifitter object for d14c computation and likelihood evaluation.
multi_interp_gp(tval, *args)
A Gaussian Process regression interpolator for MultiFitter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tval |
ndarray
|
Output time sampling |
required |
args |
ndarray | float
|
Set of annually resolved control-points |
()
|
Returns:
Type | Description |
---|---|
ndarray
|
Interpolated values on tval |
super_gaussian(t, start_time, duration, area)
Computes the density of a super gaussian of exponent 16. Used to emulates the spike in d14c data following the occurrence of a Miyake event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
t |
ndarray
|
Time sampling |
required |
start_time |
float
|
Start time of a Miyake event |
required |
duration |
float
|
Duration of a Miyake event |
required |
area |
float
|
Total radiocarbon delivered by a Miyake event |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Production rate on t |
flexible_sinusoid_affine_variant(t, *args)
A flexible sinusoid production rate model with a linear gradient. Tunable parameters are, Gradient: linear gradient
Start time: start time
log_Duration: log10 duration
Phase: phase of the solar cycle
log_Area: log10 total radiocarbon delivered
log_Amplitude: log10 solar amplitude
Parameters:
Name | Type | Description | Default |
---|---|---|---|
t |
ndarray
|
Time sampling |
required |
args |
ndarray
|
Tunable parameters. Must include, gradient, start time, duration, phase, area and amplitude |
()
|
Returns:
Type | Description |
---|---|
ndarray
|
Production rate on t |
run_burnin(y0=None, params=())
Calculates the C14 content of all the boxes within a CBM for the burn-in period.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y0 |
ndarray
|
Initial contents of all boxes |
None
|
params |
ndarray
|
Parameters for the production rate model |
()
|
Returns:
Type | Description |
---|---|
ndarray
|
Value of each box in the CBM during the burn-in period |
run_event(y0=None, params=())
Calculates the C14 content of all the boxes within a CBM for the production period.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y0 |
ndarray
|
The initial contents of all boxes |
None
|
params |
ndarray
|
Parameters for self.production function |
()
|
Returns:
Type | Description |
---|---|
ndarray
|
Value of each box in the CBM during the production period |
dc14_fine(params=())
Predict d14c on a sub-annual time sampling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ndarray
|
Parameters for the production rate model |
()
|
Returns:
Type | Description |
---|---|
ndarray
|
Predicted d14c value |
multi_likelihood(params)
Computes the ensemble log-likelihood of the parameters of self.production across multiple d14c datasets
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ndarray
|
Parameters of self.production |
required |
Returns:
Type | Description |
---|---|
float
|
Log-likelihood |
log_likelihood_gp(params)
Computes the Gaussian Process log-likelihood of a set of control-points. The Gaussian Process has a constant mean and a Matern-3/2 kernel with 1 year scale parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ndarray
|
An array of control-points. The first control point is also the mean of the Gaussian Process |
required |
Returns:
Type | Description |
---|---|
float
|
Gaussian Process log-likelihood |
log_joint_likelihood(params, low_bounds, up_bounds)
Computes the log joint likelihood of production rate model parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ndarray
|
Production rate model parameters |
required |
low_bounds |
ndarray
|
Lower bound of params |
required |
up_bounds |
ndarray
|
Upper bound of params |
required |
Returns:
Type | Description |
---|---|
float
|
Log joint likelihood |
neg_log_joint_likelihood_gp(params)
Computes the negative log joint likelihood of a set of control-points. Used as the objective function for fitting the set of control-points via numerical optimization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ndarray
|
An array of control-points |
required |
Returns:
Type | Description |
---|---|
float
|
Negative log joint likelihood |
fit_ControlPoints(low_bound=0)
Fits the control-points by minimizing the negative log joint likelihood.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
low_bound |
int
|
The minimum value each control-point can take. 0 by default. |
0
|
Returns:
Type | Description |
---|---|
OptimizeResult
|
Scipy OptimizeResult object |