loss_function: Loss Function used for the Term Structure Estimation
Description
The loss function defines the objective function used for the optimisation. In case of term structure estimation
the objective function is either the minimsation of the (weighted) squared price or the yield errors.
Usage
loss_function(p, phat, omega, weights)
Arguments
p
vector of observed prices (yields).
phat
vector of estimated prices (yields).
omega
weights vector.
weights
if "none" the squared deviation of p and
phat is not weighted, use "duration" for a duration weighted optimisation.