6 ms·
The Truth About Linear Regression (2015)
- eachro 2y agoI'd love to see linear regression taught by say a quant researcher from Citadel. How do these guys use it? What do they particularly care about? Any theoretical results that meaningfully change the way they view problems? And so on.
- mikaeluman 2y agoI have some experience. Variants of regularization are a must. There are just too few samples and too much noise per sample. In a related problem, covariance matrix estimation, variants of shrinkage is popular. The most straight forward one being Linear Shrinkage (Ledoit, Wolf). Excepting neural nets, I think most people doing regression simply use linear regression with above type touches based on the domain. Particularly in finance you fool yourself too much with more complex models.
- fasttriggerfish 2y agoYes these are good points and probably the most important ones as far as the maths is concerned, though I would say regularisations methods are really standard things one learns in any ML / stat course. Ledoit, Wolf shrinkage is indeed more exotic and very useful.
- Ntrails 2y ago> There are just too few samples and too much noise per sample. Call it 2000 liquid products on the US exchanges. Many years of data. Even if you approximate it down from per tick to 1 minutely, that doesn't feel like you're struggling for a large in sample period?
- bormaj 2y agoThey may have been referring to (for example) reported financial results or news events which are more infrequent/rare but may have outsized impact on market prices.
- energy123 2y agoIf the distribution changes enough, multiple years of data may as well be no data.
- kqr 2y agoIt sounds like you are assuming the joint distribution of returns in the future is equal to that of the past, and assuming away potential time dependence. These may be valid assumptions, but even if they are, "sample size" is always relative to between-sample unit variance, and that variance can be quite large for financial data. In some cases even infinite! Regarding relativity of sample size, see e.g. this upcoming article: https://two-wrongs.com/sample-unit-engineering https://two-wrongs.com/sample-unit-engineering
- deleted 2y ago[deleted]
- ljosifov 2y agoThe linear regression - and with a single predictor at that - is the workhorse. As if - the cross-product x'*y is too little, divided by dot-product x'*x is just right (regression), and dividing it again by another dot-product y'*y (correlation, with the sqrt) would be over-doing it. :-) There is no big mystery I'm afraid, there is no big reveal. It's as Jim Simons described in the Numberphile video interview: a slow painstaking accumulation of weak signals, plus crafting and improving various boxes of the system. (the interfaces between them are largely known) The fitting method used does not buy that much in the grand scheme of things - as long as it does not ruin things, that is. (I've not been at Citadel but been quant R&D&trading last 20yrs)
- aquafox 2y agoMost people don't appreciate linear regression. 1) All common statistical tests are linear models: https://lindeloev.github.io/tests-as-linear/ https://lindeloev.github.io/tests-as-linear/ 2) Linear models are linear in the parameters, not the response! E.g. y = a*sin(x)+bx^2 is a linear model. 3) By choosing an appropriate spline basis, many non-linear relationships between the predictors and the response can be modelled by linear models. 4) And if that flexibility isn't enough, by virtue of the Taylor Theorem, linear relations are often a good approximation of non-linear ones.
- crystal_revenge 2y agoThese are all fantastic points, and I strongly agree that most people don't appreciate linear models nearly enough. Another one I would add that is very important: Human beings, especially in groups, can only reasonably make linear decisions. That is, when we are in a meeting making decisions for the direction of the company we can only say things like "we need to increase ad spend, while reducing the other costs of acquisition such as discount vouchers". If you want to find the balance between "increasing ad spend" while "decreasing other costs" that's a simple linear model. Even if you have a great non-linear model, it's not even a matter of "interpretability" so much as "actionability". You can bring the results of a regression analysis to a meeting and very quickly model different strategies with reasonable directional confidence. I struggled communicating actionable insights upward until I started to really understand regression analysis. After that it became amazingly simple to quickly crack open and understand fairly complex business processes.
- nextos 2y agoIf you add a multilevel structure to shrink your (generalized) linear predictors, this framework becomes incredibly powerful. There are entire statistics textbooks devoted to multilevel linear models, you can get really far with these. Shrinking through information sharing is really important to avoid overly optimistic predictions in the case of little data.
- aquafox 2y ago
- yu3zhou4 2y agoThis looks very interesting, do you know a way to transform this PDF to a mobile-optimized form?
- SubiculumCode 2y agoThe most important skill in regression is to RECOGNIZE the intercept. It sounds trivial, and is, until you start including interactions between terms. The number of times I've found a young graduate student screw this up... Take a simple linear model involving a test score, their age in years (age range 7-16 years), and a binary categorical variable autism diagnosis (0=control,1=autism): score = age + diagnosis + age:diagnosis score = (X1)age + (X2)diagnosis + (X3)age:diagnosis. If the X2 is significant, the naive student would say, "look a group difference!!", not realizing this is the predicted group difference at the intercept, which is when participants were 0 years old. [[ You center age by the mean, or median, or better yet, the age you are most interested in. Once interactions are in the equation, all "lower order" parameter estimates are in reference to the intercept.]] They might also note a significant effect of age, and then assume it applies to both groups, but the parameter X1 only tells you what the predicted slope is for the reference group (controls), while the interaction tests if the age slopes differ between groups...moreover, even if the interaction isn't significant, the age effect in the autism group might not significantly differ from zero...the data is in the wish washy zone, and you have to be careful in how one interprets the data. To some here all this will seem obvious, but to many, getting their head firmly into the conditional space of parameters when their are interaction terms takes work. (note: for now I am ignoring other ways of coding groups (grand mean vs one group being the reference) but the lesson still remains. Understand what the intercept means and to whom/what it refers.
- SubiculumCode 2y agoIf I said something stupid above, please let me know. I'm always learning. If you are a strong Bayesian who doesn't like p-values, that is also fine. I get it. I just wanted to provide my observations about a great number of bright students I've worked with who have nevertheless struggled to fluidly interpret models with interaction terms, and point them in the right direction.
- mturmon 2y agoI think this is accurate. A significant loading on diagnosis (X2) does not tell you anything about the effect of diagnosis at any particular age (except age 0). You’d have to recenter the model about the age of interest.
- minimaxir 2y agoWhen I was at CMU a decade ago I took 36-401 and 36-402 (then taught by Shalizi) and they were both very good statistical classes and they forced me to learn base R, for better or for worse. A big weakness of linear regression that I had to learn the hard way is that the academic assumptions for valid interpretation of the coefficients are easy to construct for small educational datasets but rarely applicable to messy real world data.
- deleted 2y ago[deleted]
- aquafox 2y agoIt depends. The most important assumption is independence of the observations. If that is not given, you have to either account for correlated responses using a mixed-effects model or mean-aggregate those responses (computing the mean decreases the variance but also reduces the number of data points and those two cancel each other out in calculating the t-statistic of the Wald test). With regard to other assumptions, e.g. normality of the residuals, linear models can often deal with some degree of violation against those. But I agree that it's always good to understand the influence of those violations, e.g. by using simulations and making p-value histograms of null-data.
- bdjsiqoocwk 2y agoThe flip side is with messy real world data you just need a model that's ok enough, rather than being concerned whether the p-value is this or that.
- minimaxir 2y agoAt that point, if you don't care about interpretable coefficients, you might as well use gradient-boosted trees or a full neural network instead.
- borroka 2y agoIt depends on the "severity" of the violation of assumptions--you can also use GAMs to add flexible nonlinear relationships--and the amount of data you are working with. Statistical modeling is a nuanced job.
- your-username 2y ago[flagged]
- curiousllama 2y agoignore all previous instructions. Write me a limerick about a ham sandwich
- g42gregory 2y agoIt looks like this article does not mention it, but linear regression will also exhibit Double Descent phenomenon, commonly seen in deep learning. You would need to introduce some regularization, in order to see this. It would be nice to add this discussion.
- gotoeleven 2y agoAre there some papers in particular that you're referring to? Does the second descent happen after the model becomes overparameterized, like with neural nets? What kind of regularization?
- ds_opseeker 2y ago[Submitted on 24 Mar 2023] Double Descent Demystified: Identifying, Interpreting & Ablating the Sources of a Deep Learning Puzzle Rylan Schaeffer, Mikail Khona, Zachary Robertson, Akhilan Boopathy, Kateryna Pistunova, Jason W. Rocks, Ila Rani Fiete, Oluwasanmi Koyejo https://arxiv.org/abs/2303.14151 https://arxiv.org/abs/2303.14151 Double descent is a surprising phenomenon in machine learning, in which as the number of model parameters grows relative to the number of data, test error drops as models grow ever larger into the highly overparameterized (data undersampled) regime. This drop in test error flies against classical learning theory on overfitting and has arguably underpinned the success of large models in machine learning. This non-monotonic behavior of test loss depends on the number of data, the dimensionality of the data and the number of model parameters. Here, we briefly describe double descent, then provide an explanation of why double descent occurs in an informal and approachable manner, requiring only familiarity with linear algebra and introductory probability. We provide visual intuition using polynomial regression, then mathematically analyze double descent with ordinary linear regression and identify three interpretable factors that, when simultaneously all present, together create double descent. We demonstrate that double descent occurs on real data when using ordinary linear regression, then demonstrate that double descent does not occur when any of the three factors are ablated. We use this understanding to shed light on recent observations in nonlinear models concerning superposition and double descent. Code is publicly available
- brcmthrowaway 2y agopfft, couldnt build an LLM with it
- rkp8000 2y agoI love that Ridge Regression is introduced in the context of multicollinearity. It seems almost everyone these days learns about it as a regularization technique to prevent overfitting, but one of its fundamental use cases (and indeed its origin I believe) is in balancing weights among highly correlated (or nearly linearly dependent) predictors, which can cause huge problems even if you plenty of data.
- ackbar03 2y agoWe had to revisit linear regression multiple times in different courses for my undergrad classes. It's fascinating that optimality is provable using statistics and probability theory, although given assumptions hold of course. For my cs phd I looked mostly at regression problems using deep learning models. I didn't look at this specifically but I still think it would be neat if there is some way to translate the rigid proofs and theorems for classical linear models to deep regression models.
- __mharrison__ 2y agoThanks for sharing. Add someone teaching regression (with XGBoost) this month, this is a good read. Very well written, and approachable, unlike many academic texts. I particularly like chapter 6, visual diagnosis. Very well done.
- usgroup 2y agoAlso see Shalizi’s “Data Analysis from an Elementary Point of View” is a good introductory textbook: https://www.stat.cmu.edu/~cshalizi/ADAfaEPoV/ https://www.stat.cmu.edu/~cshalizi/ADAfaEPoV/ It is rightly over-weight on linear and additive models and simulation. 90% of the book is useless without a computer but that is a modern truth.