Dollar portfolio from a deflated wealth martingale (source code)

= Dollar portfolio from a deflated wealth martingale
{title2=$\theta_t=(h_t/\zeta_t+\kappa_tw_t)/\sigma_t$}

In the completed <natural Brownian filtration>, suppose $dS_t/S_t=\mu_tdt+\sigma_tdW_t$ with $\sigma_t\ne0$, and let $d\zeta_t=-\zeta_t(r_tdt+\kappa_tdW_t)$, $\kappa_t=(\mu_t-r_t)/\sigma_t$. For an affordable nonnegative terminal claim $X$, represent the <conditional-expectation martingale> $N_t=\mathbb E[\zeta_TX\mid\mathcal F_t]$ as $dN_t=h_tdW_t$. Then $w_t=N_t/\zeta_t$ and the displayed dollar amount in the <stock> replicate $X$. The <Itô product rule> gives $d(\zeta w)=\zeta(\sigma\theta-\kappa w)dW$, proving the formula; share holdings are $\theta_t/S_t$.