FinanceModels.Fit API Reference

Exported API

Unexported API

FinanceModels.Fit.BootstrapType
Bootstrap()

A singleton type passed to fit to bootstrap a spline curve one quote at a time. Each step solves for the zero rate at the next quote maturity to match its price.

A subtype of FitMethod.

Examples

quotes = ZCBPrice([0.99, 0.97, 0.94])
curve = fit(Spline.Linear(), quotes, Fit.Bootstrap())
discount(curve, 2) ≈ 0.97 # true
source
FinanceModels.Fit.LossType
Fit.Loss(function)

function should be a loss measure, such as x->x^2 or x->abs(x). This is used by the optimization algorithm in fit to determine optimal parameters as defined by this loss function.

A subtype of FitMethod.

Examples

julia> mod0 = Yield.Constant();

julia> quotes = ZCBPrice([0.9, 0.8, 0.7,0.6]);

julia> fit(mod0,quotes,Fit.Loss(x->x^2))
FinanceModels.Yield.Constant{Rate{Float64, Periodic}}(Periodic(0.12822921882254446, 1))

(With UnicodePlots loaded, fitted yield models display as a zero-rate chart instead.)

source

Please open an issue if you encounter any issues or confusion with the package.