I have a mean reverting time series and want to find the Ornstein-Uhlenbeck (OU) parameters of it. I researched the internet and found that we can calibrate the model as a simple AR(1) process, $$\text dS_{t} = \lambda(\mu-S_t)\text dt+\sigma \text dW_t,$$ where $\lambda$ is the mean reversion rate, $\mu$ the mean and $\sigma$ the volatility.
The exact solution of the above SDE is \begin{align*} S_{i+1} = S_i e^{-\lambda\delta} + \mu(1-e^{-\lambda\delta}) + \sigma \sqrt{\frac{(1-e^{-2\lambda\delta})}{2\lambda}}N_{0,1}, \tag{1} \end{align*} where $\delta$ is a small time increment.
An AR(1) process is \begin{align*} S_{i+1} = aS_i+b+\varepsilon. \tag{2} \end{align*} Comparing the AR(1) process with the exact solution of the SDE, we can get the following relations \begin{align*} \lambda &= -\frac{\ln a}{\delta} \tag{3} \\ \mu&=\frac{b}{1-a} \tag{4} \\ \sigma &= \text{stdev}(\epsilon) \sqrt{\frac{-2\ln a}{\delta(1-a^2)}} \tag{5} \end{align*}
I fitted a simple OLS model for (2) and $a$ turns out to be negative (e.g., $a=-0.03$). We can neither obtain $\lambda$ nor $\sigma$ as they have $\ln(a)$ and we cannot take log of a negative value.
My question is very similar to link. I looked into these supporting stack exchange links (1, 2, 3) but none of the links could give a solution to my issue
Also I understand when estimating half life using AR(1) we should use $-\frac{\ln(2)}{\ln(|a|)}$ and half life of OU is $\frac{\ln(2)}{\lambda}$. Associated link. Should I take absolute value of $a$ in Equations (3) and (5)?