Repository navigation
Conversation
There was a problem hiding this comment.
Why not r = self.est_model.resid?
There was a problem hiding this comment.
because I'm working here with res_trimmed : res_trimmed.resid (from self.est_model fit) doesn't contain all observations, only the inliers.
So. I need to calculate the errors for the full dataset given by endog exog, not the one from the "trimmed" dataset endog[iin], exog[iin]
(aside: in the initial estimate with the random starting values iin only contains k_vars + 1 observations, not really all inliers.)
There was a problem hiding this comment.
Again, I think this is related to the way the first stage is performed: your aircraft example clearly shows that the best solutions at stage 1 do not generalizes well at stage 2. A larger n_keep should not improve the results, otherwise this would mean that the best solution on the whole dataset has a very small link with the best solution at stage 1 and we should therefore question the use of such a two-steps algorithm.
What do you think?
There was a problem hiding this comment.
I looked at the Hawkins paper again, for there pairwise swapping of observations algorithm they have 16% going to the best and 34% going to the third best solution. Not as bad as I remember, but my impression was the set of converged solutions is larger with the RVD LTS algorithm.
some back of the envelope calculations
"So 18 random starting subsets will give a 95% chance of having one lead to the global optimum" quote for aircraft data. 7 convergence sets cover almost 90 % of the starting values, that's about an 18 % chance of converging to the best. To have a 99 % probability of converging to the best solution, we would need roughly 23 starting values.
So if there is a good chance of getting many reasonably good estimates in the first stage, then it might not include the best case for the second stage if n_keep is too small. Also using additional c-steps in the first stage might not help a lot in this case, it just weeds out the awful cases but not the pretty-good-but-not-best cases.
side remark: besides the Hawkins and other traditional datasets, I would have liked to get a collection of models for generating data and test cases that have been used in different papers. I doubt the same settings will be very good for all test cases.
There was a problem hiding this comment.
Fine. Thanks fir the explanation!
Regarding data generation, I also doubt that a module covering the entire range of possible polluted data could be made. It is yet especially important for LTS since the complex structure of the algorithm makes it sensitive to specific data settings.
I coded a data generation module for the MCD test cases but I doubt it would be useful for LTS.
|
I had a look at the LTS object and the associated algorithm. I did not look at the examples or the advanced uses of LTS yet (i.e. efficient lts, inclusion with MM-estimators, MTL, ...). |
|
Thanks Virgile, and thanks for the review |
|
rebased version in #8125 |
extensions to robust estimation
least trimmed squares
efficient least trimmed squares
mm-estimation
maximum trimmed likelihood
basic models work and look good in MonteCarlo and some examples from papers
no unit tests yet
incomplete integration with RLM
doesn't work with dummy variables yet: if subsets exog is singular, then it doesn't draw extra starting cases, and it breaks (raises exception) in the Poisson case.
no large sample split for FastLTS yet