# How to extract parameters in the CIR model from data?

I want to extract CIR parameters from monthly LIBOR data in the EULER-MARYAMA method in MATLAB language. I found the data but I can't extract parameters from it. What is the process? What is the formula?

As You Know, CIR model is the square root process given by the following stochastic differential equation $$d{{r}_{t}}=\kappa (\theta -{{r}_{t}})dt+\sigma \sqrt{{{r}_{t}}}d{{W}_{t}}$$ Let $\Theta=(\kappa,\theta,\sigma)$. It is well-known that conditional on a realized value of $r_t$, the random variable $2c_t\,r_{t+\Delta t}$ follows a non-central chi-square distribution with $d = 4\kappa\theta/\sigma^2$ degrees of freedom and non-centrality parameter $2c_t\,r_te^{−κ\Delta t}$, where $$c_t=\frac{2\kappa }{{{\sigma }^{2}}\,[1-{{e}^{-\kappa \Delta t}}]}$$ Indeed the density of $r_{t+\Delta t}$ is $$P(r_{t+\Delta t}|r_t;\Theta)=c\,e^{-u-v}(\frac{u}{v})^{\frac{q}{2}}I_q(2\sqrt{uv})$$ where
$$\,\,\,u_t=c_t\,r_te^{−κ\Delta t}$$ $$v_t=c_t\,r_{t+\Delta t}$$ $$\,\,\,\,\,\,\,q=\frac{2\kappa\theta}{\sigma^2}-1$$ and $I_q(2\sqrt{uv})$ is modified Bessel function of the first kind and of order $q$. The transition density has been originally derived in this.
Parameter estimation is carried out on interest rate time series with N observations We consider equally spaced observations with $\Delta t$ time. The likelihood function for interest rate time series with $N$ observations is step $$L(\Theta )=\prod\limits_{i=1}^{N-1}{P({{t}_{t+\Delta t}}}|\,{{r}_{t}}\,;\,\Theta )$$ It is computationally convenient to work with the log-likelihood function $$\ln L(\Theta )=\sum\limits_{i=1}^{N-1}{\ln P({{t}_{t+\Delta t}}}\,|{{r}_{t}}\,;\,\Theta )$$ from which we easily derive the log-likelihood function of the CIR process $$\ln L(\Theta )=(N-1)\ln c+\sum\limits_{i=1}^{N-1}{\left( -{{u}_{{{t}_{i}}}}-{{v}_{{{t}_{i}}}}+\frac{1}{2}q\,\ln \left( \frac{{{v}_{{{t}_{i+1}}}}}{{{u}_{{{t}_{i}}}}} \right)+\ln {{I}_{q}}(\sqrt{2{{u}_{{{t}_{i}}}}{{v}_{{{t}_{i+1}}}}} \right)}$$ You can find maximum likelihood estimates $\widehat{\Theta }$ of parameter vector $\Theta$ by maximizing the log-likelihood function last equation over its parameter space: $$\widehat{\Theta }=arg\,\underset{\Theta }{\mathop{max}}\,\,\ln \,L(\Theta )$$