Collocation Interface
The two-stage estimator accepts either one of the built-in kernel symbols or a custom DiffEqParamEstim.CollocationKernel implementation. A custom kernel is a field-free subtype that extends DiffEqParamEstim.calckernel for scalar numeric offsets. The method must return one scalar weight and should preserve the numeric type of its offset so that automatic differentiation can propagate through the objective.
This is a developer interface. It is documented and versioned for packages that extend the two-stage estimator, but it is not exported as part of the ordinary user API.
DiffEqParamEstim.CollocationKernel — Type
CollocationKernelDeveloper interface for the kernel used by two_stage_objective to smooth the observed state trajectory before estimating its derivative.
CollocationKernel is an abstract, field-free marker type. To add a custom
Interface
- Define a field-free subtype of
CollocationKernel. - Extend
DiffEqParamEstim.calckernel(::MyKernel, t)for scalar numerict. - Return one scalar weight for each offset;
two_stage_objectivebroadcasts the method over all normalized time offsets. - Keep the implementation generic over the numeric type of
tso that automatic-differentiation element types are preserved.
The built-in implementations are EpanechnikovKernel, UniformKernel, TriangularKernel, QuarticKernel, TriweightKernel, TricubeKernel, GaussianKernel, CosineKernel, LogisticKernel, SigmoidKernel, and SilvermanKernel.
Examples
struct MyKernel <: DiffEqParamEstim.CollocationKernel end
DiffEqParamEstim.calckernel(::MyKernel, t) = exp(-abs(t))
objective = two_stage_objective(prob, tpoints, data; kernel = MyKernel())DiffEqParamEstim.calckernel — Method
calckernel(kernel::CollocationKernel, t) -> NumberReturn the scalar smoothing weight for kernel at the normalized offset t.
This is a developer extension point rather than a user-facing operation. A custom CollocationKernel must provide a method for its own type. The method is called with scalar offsets and must preserve the numeric type of t when practical; this allows the two-stage objective to work with automatic differentiation values.
Arguments
kernel::CollocationKernel: the kernel marker selecting the weighting rule.t: a scalar normalized time offset.
Returns
Number: the kernel weight att.
Examples
struct ExponentialKernel <: DiffEqParamEstim.CollocationKernel end
DiffEqParamEstim.calckernel(::ExponentialKernel, t) = exp(-abs(t))
weight = DiffEqParamEstim.calckernel(ExponentialKernel(), 0.25)DiffEqParamEstim.EpanechnikovKernel — Type
EpanechnikovKernel()Select the Epanechnikov compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data;
kernel = EpanechnikovKernel())DiffEqParamEstim.UniformKernel — Type
UniformKernel()Select the uniform compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = UniformKernel())DiffEqParamEstim.TriangularKernel — Type
TriangularKernel()Select the triangular compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data;
kernel = TriangularKernel())DiffEqParamEstim.QuarticKernel — Type
QuarticKernel()Select the quartic compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = QuarticKernel())DiffEqParamEstim.TriweightKernel — Type
TriweightKernel()Select the triweight compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data;
kernel = TriweightKernel())DiffEqParamEstim.TricubeKernel — Type
TricubeKernel()Select the tricube compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = TricubeKernel())DiffEqParamEstim.GaussianKernel — Type
GaussianKernel()Select the Gaussian kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = GaussianKernel())DiffEqParamEstim.CosineKernel — Type
CosineKernel()Select the cosine compact-support kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = CosineKernel())DiffEqParamEstim.LogisticKernel — Type
LogisticKernel()Select the logistic kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = LogisticKernel())DiffEqParamEstim.SigmoidKernel — Type
SigmoidKernel()Select the sigmoid kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data; kernel = SigmoidKernel())DiffEqParamEstim.SilvermanKernel — Type
SilvermanKernel()Select the Silverman kernel for two_stage_objective.
The type is an immutable, field-free CollocationKernel marker.
Examples
objective = two_stage_objective(prob, tpoints, data;
kernel = SilvermanKernel())