Least-squares method in normfit with censoring?
이전 댓글 표시
Can someone explain to me what the normfit function is doing with censoring? What is censoring? I am looking at the code of the function normfit.m and I am not really sure what exactly it is doing. Thanks!
답변 (1개)
Tom Lane
2012년 8월 10일
0 개 추천
If I test a bunch of lightbulbs for a month and see how long they last, maybe half of them will burn out and I will be able to observe their lifetimes exactly. For the others that don't burn out, I don't know what their lifetime is. I only know that they are all larger than one month. Their lifetimes are said to be censored at one month.
It's possible to compute the likelihood for this scenario. The normfit function estimates the parameters by maximizing the likelihood.
Your heading mentions least squares. The normfit function takes a single sample of data, not x/y data, so it's not typical to refer to what it does as least squares.
댓글 수: 4
Marmi Afrin
2012년 8월 10일
Tom Lane
2012년 8월 10일
Ah, I see. This least squares fit is basically a fit to points on a normal probability plot. However:
- It's only done in the case of censoring.
- It's only done to get starting values.
The function uses the result of this least squares fit to start off an optimizer that tries to maximize the likelihood function.
So in my example, we can't compute the mean lifetime because we haven't observed all the lifetimes. We can maximize the likelihood function. The least squares trick just gets us started in that direction.
Marmi Afrin
2012년 8월 17일
Tom Lane
2012년 8월 17일
Let's back up. This histfit function can fit a normal distribution to data and overlay the density on the histogram. Is that what you need? This function doesn't return the fit parameters, but you could look inside the function and see what it does.
If this "doesn't give the right fit" it would be helpful to have more details on that. Perhaps a normal fit doesn't work well, or it's too sensitive to outliers, or it doesn't capture outliers, or ....?
카테고리
도움말 센터 및 File Exchange에서 Half-Normal Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!