Multivariate Linear Regression with Weibull errors
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Prachi Singh
il 3 Mag 2016
Modificato: Prachi Singh
il 9 Mag 2016
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 Commenti
Risposta accettata
John D'Errico
il 8 Mag 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 Commenti
John D'Errico
il 8 Mag 2016
Modificato: John D'Errico
il 8 Mag 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.
Più risposte (1)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!