I have data on financial returns, and I want to fit the Cauchy distribution and student distribution to that data. Furthermore I want to check the goodness of fit in both cases. Where should I start from?
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
|
If I had a series of iid data $X_1, \dots, X_n$ that I assumed come from a Cauchy distribution with density $$ f(x;\mu,\sigma)= \frac{1}{\sigma}\frac{1}{\pi(1+((x-\mu)/\sigma)^2} $$ Here is how I would do that in R: first, the log-density in R is the function
then a function construction the log-likelihood function:
then actually making the loglik function: loglik <- make_loglik(x) and finally, maximizing this using For the t-dist, you could just replace the cauchy density above with the t-density, but you should be aware that the t-likelihood is unbounded as a function of the degrees-of-freedom parameter! so just optimizing the likelihood might go very bad! |
|||||||||||
|