Hi everyone, I'm programming in MATLAB and I have the following optimization problem in calibrating several nested specifications of pricing models.
Summary: I have two pricing models ($1$ and $2$, $1$ is nested in $2$, i.e. model $2$ reduces to model $1$ if a particular configuration of its parameters is considered) and two sets of derivatives ($A$ and $B$). I calibrate each model on the two sets of instruments AT THE SAME TIME, minimizing pricing errors. That's fine. The problem arises in the nesting request: I want model $2$ to produce lower pricing errors on BOTH instruments sets SEPARATELY and I'm wondering if can define a loss function that automatically achieves this task, i.e. I want that this consistency condition holds: \begin{equation} \left\{ \begin{aligned} error_{A}[2] \leq error_{A}[1] \\ error_{B}[2] \leq error_{B}[1] \end{aligned} \right. \end{equation} and NOT ONLY $$ error_{A}[2] + error_{B}[2] \leq error_{A}[1] + error_{B}[1] $$ end of summary.
I'm considering two sets of derivatives I would like to price, say $A$ and $B$. In the class $A$, there are $i=1,...,N$ instruments, with market prices denoted as $a^{i}_{MKT}$, and in the other one there are $j=1,...,M$ instruments, whose market prices are denoted with $b^{j}_{MKT}$.
I start with a model $1$, depending on a set $\{x\}$ of parameters. Under this model, model prices for instruments $A$ and $B$ are denoted as $a^{i}_{mdl}(x)$ and $b^{j}_{mdl}(x)$.
The simple idea is to calibrate model parameters $\{x\}$ minimizing the pricing error. For example minimizing the Sum-of-Squared-Errors loss:
\begin{equation} \begin{aligned} loss(x) &= loss_{A}(x) + loss_{B}(x) \\ &= \sum^{N}_{i=1}\left|a^{i}_{MKT} - a^{i}_{mdl}(x) \right|^2 + \sum^{M}_{j=1}\left|b^{j}_{MKT} - b^{j}_{mdl}(x) \right|^2 \end{aligned} \end{equation}
In this way, the optimal parameters $\{x_{opt}\}$ will be those minimizing $loss(x)$. Let it be: \begin{equation} \begin{aligned} loss(x_{opt}) &= loss_{A}(x_{opt}) + loss_{B}(x_{opt}) \\ &\stackrel{def}{=} error_{A}[1] + error_{B}[1] \end{aligned} \end{equation}
Now my problem: I'm considering a model $2$ which is a generalization of the model $1$, In the sense that model $2$ depends on the extended parameter set $\{x,y\}$. Model $2$ produces model prices $\hat{a}^{i}_{mdl}(x,y)$ and $\hat{b}^{j}_{mdl}(x,y)$. For the sake of exposition you may think that model $2$ reduces to model $1$ if $y=0$, i.e. $\hat{a}^{i}_{mdl}(x,0) = a^{i}_{mdl}(x)$ and $\hat{b}^{i}_{mdl}(x,0) = b^{i}_{mdl}(x)$.
Now if I keep using the above SSE $loss$ to calibrate model $2$, I will minimize \begin{equation} \begin{aligned} loss(x,y) &= loss_{A}(x,y) + loss_{B}(x,y) \\ &= \sum^{N}_{i=1}\left|a^{i}_{MKT} - \hat{a}^{i}_{MDL}(x,y) \right|^2 + \sum^{M}_{j=1}\left|b^{j}_{MKT} - \hat{b}^{j}_{mdl}(x,y) \right|^2 \end{aligned} \end{equation} Optimized parameters for model $2$ will be $\{x_{opt},y_{opt}\}$ and correspondingly we define: \begin{equation} \begin{aligned} loss(x_{opt},y_{opt}) &= loss_{A}(x_{opt},y_{opt}) + loss_{B}(x_{opt},y_{opt}) \\ &\stackrel{def}{=} error_{A}[2] + error_{B}[2] \end{aligned} \end{equation} Now the above calibrations produce the following nesting relation for sure: $$ error_{A}[2] + error_{B}[2] \leq error_{A}[1] + error_{B}[1] $$ but NOT NECESSARY \begin{equation} \left\{ \begin{aligned} error_{A}[2] \leq error_{A}[1] \\ error_{B}[2] \leq error_{B}[1] \end{aligned} \right. \end{equation} that is what I want. For example, model $2$ may highly improve pricing of $A$ derivatives, but slightly mis-pricing on the set $B$, w.r.t. model $1$. What I want is that model $2$ improve pricing w.r.t. to model $1$ on BOTH $A$ and $B$ sets!
Can anybody suggest me a loss/calibrating procedure/whatever achieving this goal. Thank you in advance for your time and attention.
Technical note: my procedure is performed with lsqnonlin, in the Matlab optimization toolbox.