Firstly I find the spread between two cointegrated time-series $Y_t$ and $Z_t$ by finding the best slope parameter $\beta$ in the equation $spread_t = Y_t - \beta Z_t$ (via Cointegrated Dickey-Fuller Test). Then I say $spread_t = X_t$ and fit my Ornstein-Uhlenbeck model as described below.
I then have a mean-reverting Ornstein-Uhlenbeck process $X_t$ described by an SDE $$dX_t = \lambda (\mu - X_t) dt + \sigma dW_t \tag{1}$$
where the parameters are:
- $\lambda > 0$ : mean reversion coefficient
- $\mu \in \mathbb{R}$ : long-term mean
- $\sigma > 0$ : volatility coefficient
I use an exact discretization for this process:
$X_{t+1} = X_ie^{-\lambda\delta}+\mu(1-e^{-\lambda\delta}) +\sigma \sqrt{\frac{1-e^{-2\lambda\delta}}{2\lambda}}N_{0,1}$ where $N$ is a standard normal distribution.
To calibrate the process in order to find the parameters, I set a log-likelihood function of a set of observations that is derived from the conditional density function:
$$ \mathcal{L}(\mu, \lambda, \hat{\sigma})=\sum_{i=1}^{n} \ln f\left(X_{i} X_{i-1} ; \mu, \lambda, \sigma\right) \\ =-\frac{n}{2} \ln (2 \pi)-n \ln (\hat{\sigma}) -\frac{1}{2 \hat{\sigma}^{2}} \sum_{i=1}^{n}\left[X_{i}-X_{i-1} e^{-\lambda \delta}-\mu\left(1-e^{-\lambda \delta}\right)\right]^{2}. $$
We then find the three parameters by equating each partial derivative of the log-likelihood function to zero (w.r.t to each parameter).
My question is the following:
Would it be valid to skip the first step, i.e. the cointegration step and find the $\beta$ at the same time as the Ornstein-Uhlenbeck parameters. So I would then have
$$d(Y_t - \beta Z_t) = \lambda (\mu - (Y_t - \beta Z_t)) dt + \sigma dW_t$$ (since I set $X_t = (Y_t - \beta Z_t)$ in $(1)$ above) as my Ornstein-Uhlenbeck process.
I would then find a new log-likelihood function that also includes the parameter $\beta$: $$\mathcal{L}(\mu, \lambda, \hat{\sigma}, \beta) = \dots $$
I am not sure this makes sense, since before we fully knew what the $X_t$ process was (a given time-series we want to model) but now our $X_t$ process is $X_t=Y_t - \beta Z_t$ where $\beta$ is unknown.