## Libor.LiborDerivatives Class TriggerSwap

```java.lang.Object Libor.LiborDerivatives.LiborDerivative Libor.LiborDerivatives.TriggerSwap
```

public class TriggerSwap
extends LiborDerivative

The trigger swap on `[T_p,T_q]` with trigger level `K` and strike rate `kappa` is triggered at the first time `T_j` such that `L_j(T_j)>K` and then initiates a swap `swap([T_j,T_q],kappa)`.

This is a nasty derivative for which Monte Carlo converges very slowly. You might want to think about writing pricing routines that generate Libor paths until a desired precision is reached with desired confidence. This is a trivial task since the forward payoff is available as a (controlled) `RandomVariable` and this class offers such methods.

The payoff of the cap `cap([T_p,T_q],kappa)` shows excellent correlation with the trigger swap payoff (run `main()` for an example) and is thus used as a control variate for the trigger swap.

 Constructor Summary ```TriggerSwap(LiborProcess LP, int p, int q, double kappa, double K)```           Libors `L_j` needed for ```j>=p and until time min(T_q,T_{n-1}).```

 Method Summary ` double` `controlVariateMean(int t)`           Control variate is the cap `cap([T_p,T_q],kappa)` forward payoff and so its mean is the cap forward price. ` double[]` `currentControlledForwardPayoff()`           Control variate is the forward payoff of the cap `cap([T_p,T_q],kappa)`. ` double` `currentForwardPayoff()`           The payoff transported forward to time `T_n`, value in current Libor path. `static void` `main(java.lang.String[] args)`           Test program.

 Methods inherited from class Libor.LiborDerivatives.LiborDerivative `analyticForwardPrice, controlledForwardPayoff, controlledMonteCarloForwardPrice, forwardPayoff, lognormalForwardPayoff, lognormalForwardPayoffSample, lognormalMonteCarloForwardPrice, monteCarloForwardPrice`

 Methods inherited from class java.lang.Object `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

 Constructor Detail

### TriggerSwap

```public TriggerSwap(LiborProcess LP,
int p,
int q,
double kappa,
double K)```

Libors `L_j` needed for ```j>=p and until time min(T_q,T_{n-1}).```

``` ```
`Parameters:`
`LP - underlying Libor process.`
`p - accrual starts T_p.`
```q - accrual stops T_q, with 0<p<q<=n.```
`kappa - strike level.`
`K - trigger level.`
``` Method Detail currentForwardPayoff public double currentForwardPayoff() The payoff transported forward to time T_n, value in current Libor path. Specified by:currentForwardPayoff in class LiborDerivative controlVariateMean public double controlVariateMean(int t) Control variate is the cap cap([T_p,T_q],kappa) forward payoff and so its mean is the cap forward price. Overrides:controlVariateMean in class LiborDerivative Parameters:t - current discrete time t<=p. currentControlledForwardPayoff public double[] currentControlledForwardPayoff() Control variate is the forward payoff of the cap cap([T_p,T_q],kappa). Overrides:currentControlledForwardPayoff in class LiborDerivative main public static void main(java.lang.String[] args) Test program. Allocates a Libor process of dimension n=15 and prices the trigger swap TRGSWP(p,q,kappa,K) with p=5, q=15, kappa=0.06, K=0.10. All Libors are intialized at L_j(0)=0.04. The correlation of the trigger swap payoff with the control variate is computed also. Moves the Libor path forward to time t=T_3 and computes the Monte Carlo forward price of the floater and compares it to the analytic price computed directly from the Libors at time t=T_3. Overview  Package   Class  Tree  Deprecated  Index  Help   PREV CLASS   NEXT CLASS FRAMES    NO FRAMES     <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> All Classes SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD ```