I have a stochastic process to model the stochastic discount factor (SDF) with M: \begin{equation} dM_t = aM_tdt + bM_t d Z_t \end{equation} where, $Z_t$ is a standard brownian motion. How do I show that $a = -r$, where $r$ is the continuously compounded risk-free rate? I think that I should use the following equation that the SDF requires, \begin{equation} E(M_t e^{rt}) = 1 \end{equation} or, \begin{equation} E(M_t) = e^{-rt}. \end{equation} I am close to the answer, but I don't know how to put it all together to prove $a = -r$.
Also, we can setup a differential equation for a risky asset $S_t$: \begin{equation} dS_t = \mu S_t dt + \sigma S_t dZ_t. \end{equation} How do I prove that $b = - \frac{\mu - r}{\sigma}$?