Least-squares method in normfit with censoring?
6 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Tom Lane
on 10 Aug 2012
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 Comments
Tom Lane
on 17 Aug 2012
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 ....?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!