Multivariate Linear Regression with Weibull errors
6 views (last 30 days)
Show older comments
Hi,
I am trying to run a linear regression where the dependent variable lies between 0 and 1. The errors are distributed by 2 parameter Weibull distribution. So essentially I will be estimating 4 parameters: a constant, a parameter for an independent variable and 2 parameters of the weibull distribution. Can somebody guide me as to how I proceed to do this? I am mostly getting search results for survival data but my data is non-survival data. Thanks!
0 Comments
Accepted Answer
John D'Errico
on 8 May 2016
Do some reading about maximum likelihood estimation . This is the general technique one uses for an estimation problem where the errors in the process are assumed to follow some known distribution that is not Gaussian.
Sorry, but I won't write the code for you. One hint I will offer is that it is almost always better to maximize the log (i.e., minimize the negative of the log) of the likelihood function, as otherwise the problem quickly becomes intractable in double precision arithmetic.
4 Comments
John D'Errico
on 8 May 2016
Edited: John D'Errico
on 8 May 2016
Let me explain in a little more detail what this will involve.
You need to have an objective function that for ANY set of 4 parameters, thus two line parameters, and two Weibull parameters...
1. Compute the residual. That MUST be a positive number for all data points, so you need to use a tool than can handle constraints.
2. Given the set of PRESUMED Weibull parameters, compute the Weibull PDF for each of those residuals, for those given parameters.
3. Return the product of those individual values from the PDF. This may be a very tiny number, in fact, you will almost always see underflows in this. So it is better if you compute the sum of logs of those values, and maximize that sum instead.
So this will be a 4 parameter optimization, subject to linear inequality constraints at each data point, as well of course, on the Weibull parameters since the shape and scale parameters for the Weibull must both be positive.
The best tool for the optimization would arguably be something like fmincon, although even there you need to be careful, since fmincon does allow for tiny constraint deviations. It's been a while since I looked, but one of the algorithms in fmincon may assure strict adherence of the constraints.
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!