# Nonlinear Constrained optimization for a CIR model

I want to calibrate a CIR model which is commonly used to model the evolution of interest rates. Briefly speaking, we know that its dynamics is of the form

$$$$dr_t = \kappa (\theta - r_t) dt + \sigma \sqrt{r_t} dW_t$$$$ where $$\kappa$$, $$\theta$$, and $$\sigma$$ are positive parameters, and $$W_t$$ is a standard Brownian motion process. All parameters can be estimated using maximum likelihood estimation (MLE) method. In practice, we consider the following problem, which can be calculated through a numerical optimization, for example, optim() function in R: $$$$(\hat{\theta}, \hat{\kappa}, \hat{\sigma})=\max_{\theta >0, \kappa >0, \sigma >0} log(L(\theta, \kappa, \sigma; \boldsymbol{r}))$$$$

where $$L(\theta, \kappa, \sigma; \boldsymbol{r})$$ stands for the likelihood function of the CIR model and $$\boldsymbol{r}$$ represents a sample of size $$n$$.

In my opinion, there is one thing that needs to be considered when estimating parameters. We know that there is a condition under which we make sure that the interest rate governed by the above SDE will not reach zero and remain positive. That is, we also have this constrain $$2\theta \kappa > \sigma ^2$$. I wonder if we do not need to take into account this constraint. More precisely, one can have a look at the following optimization instead: $$$$(\hat{\theta}, \hat{\kappa}, \hat{\sigma})=\max_{\theta >0, \kappa >0, \sigma >0} log(L(\theta, \kappa, \sigma; \boldsymbol{r}))\\ \text{s.t} \quad 2\theta \kappa > \sigma^2$$$$

This means that we should find the optimal values under these four constraints. I see that most majority of people overlook this matter. Please let me know what you think in this regard.

• TBH, I've usually encountered people / papers to correctly incorporate the Feller condition. May 4, 2022 at 19:24
• Yes, you are right, but in the optimization process, they just use optim() function to find the estimation. When it comes to the implementation part, all these details are ignored (nobody knows what is going on under the hood ;) May 5, 2022 at 5:20
• @Kermittfrog, like you I have also read many papers and have seen that authors mention the feller condition for the CIR model. But do not forget, what you read in a paper does not essentially comply with its corresponding computation in practice, it is a sad story. May 5, 2022 at 5:26