Histogram then a curve fitting to compare with normal

조회 수: 9 (최근 30일)
Mate 2u
Mate 2u 2012년 2월 5일
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.

채택된 답변

the cyclist
the cyclist 2012년 2월 5일
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().

추가 답변 (1개)

Richard Willey
Richard Willey 2012년 2월 6일

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by