Histogram then a curve fitting to compare with normal

9 vues (au cours des 30 derniers jours)
Mate 2u
Mate 2u le 5 Fév 2012
Dear Everbody, I have a array of daily returns of size 1775.
When I use:
histfit(GLLlogreturn, 60)
I get a histogram with a normal curve superimposed.
Is there a way I can get a curve fitting tool to match my data as a comparison to the normal distribution curve?
So 3 things on 1 plot: Histogram, Curve fitting of my data, Normal curve.

Réponse acceptée

the cyclist
the cyclist le 5 Fév 2012
It's not perfectly clear to me what you want, but here are a couple factoids for you.
First, it's important to realize that the normal curve that histfit() calculates is a fit to the underlying data, not to the histogram of the data. So, if what you want is a normal curve fit to your curve, histfit() is doing what you want.
If you don't want a normal curve, then what do you mean by "curve fitting of your data"? Do you have some other functional form in mind? MATLAB can fit to many different functions.
If you want to do something non-parametric rather than a specific function, then one possibility is to do a kernel density estimation. MATLAB has a function for that as well: ksdensity().

Plus de réponses (1)

Richard Willey
Richard Willey le 6 Fév 2012


En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by