Exponential-affine bond pricing (source code)

= Exponential-affine bond pricing
{title2=$P_{t,T}=e^{\alpha(T-t)X_t+\beta(T-t)}$}

If a discrete-time <martingale deflator> obeys $Y_t/Y_{t-1}=e^{X_t}$ for an <affine process> $X$, unit <zero-coupon bonds> have exponential-affine prices. For one-step coefficients $A,B$, the recursion is $\alpha(0)=\beta(0)=0$, $\alpha(n+1)=A(1+\alpha(n))$, $\beta(n+1)=\beta(n)+B(1+\alpha(n))$.