4
$\begingroup$

I am working through the book Applied Predictive Modeling and came across something that was a bit confusing.

It discussed adding non linearity to a model to improve its fit - I get this part.

For example: $x^2 + 2x - 4$

What is the interpretation of these values though?

When we are using just a normal linear regression or a multivariate regression, we would say that the coefficients like 2 would suggest its relative importance relative to the other features being included in the model. However, what does this mean in the context of quadratic functions?

ie. Fuel efficiency of a car based on 2 Displacement + Displacement$^2$ -4

What exactly does displacement squared mean?

Any help would be greatly appreciated.

Thanks.

$\endgroup$

4 Answers 4

2
$\begingroup$

The OP is asking for an interpretation of the quadratic term, however the other answers seem a bit superficial to me, so here is my attempt at a more encompassing answer.

Interpretation of Quadratic Terms in Linear Regression

Quadratic terms in regression model non-linear relationships between a predictor $x$ and an outcome $y$. The general form of a regression model with a quadratic term is:

$$ y = \beta_0 + \beta_1 x + \beta_2 x^2 + \epsilon $$

where $\epsilon$ is the error term.


Key Points of Interpretation

1. Role of the Quadratic Term

  • The quadratic term $x^2$ introduces curvature into the model, allowing the slope of the relationship to vary with $x$.
  • The coefficient $\beta_2$ determines the curvature:
    • $\beta_2 > 0$: U-shaped (convex).
    • $\beta_2 < 0$: Inverted U-shaped (concave).

2. Slope and Turning Point

  • The slope of $y$ with respect to $x$ is:

    $$ \frac{dy}{dx} = \beta_1 + 2\beta_2 x $$

    This slope changes linearly with $x$, indicating how the effect of $x$ on $y$ accelerates or decelerates.

  • The turning point (vertex) occurs where the slope equals zero:

    $$ x = -\frac{\beta_1}{2\beta_2} $$

    At this point, $y$ reaches a maximum or minimum, depending on the sign of $\beta_2$.

3. Practical Example

Consider the same model as in the OP, where I am using $x$ for displacement and $y$ for Fuel efficiency: $$y = x^2 + 2x - 4$$:

  • The linear term $2x$ suggests efficiency initially increases with displacement.
  • The quadratic term $x^2$ introduces a point where diminishing returns occur.
  • The relationship is U-shaped (convex), with a minimum efficiency at $x = -1$. Obviously this does not make sense, which highlights a number of things, not least that extrapolation must be done with extreme caution.

Alternatives to Quadratic Terms

Quadratic terms are effective for simple curvatures but may fail to capture more complex trends. Alternative methods include:

  1. B-Splines/Natural Splines:

    • Offer flexible and smooth modelling for non-linear relationships.
    • Reduce the risk of overfitting with better control over curvature.
  2. Generalised Additive Models (GAMs):

    • Fit smooth, non-linear relationships without pre-specifying the curve’s shape.
    • Use penalties to prevent overfitting, ensuring better generalisation.

Avoiding Overfitting

Introducing quadratic or non-linear terms increases model complexity. To mitigate overfitting:

  • Use regularisation techniques like ridge or lasso regression.
  • Validate models using cross-validation or a test dataset.

Summing Up

Quadratic terms are a powerful tool for modelling simple non-linear relationships. However, more flexible methods like splines or GAMs may be preferable for capturing complex curvatures.

References

  1. Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning. Springer.
  2. Wood, S. (2017). Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC.
$\endgroup$
1
$\begingroup$

$Displacement$ component gives us a "line" to fit over the data points. To get more freedom add $Displacement^{2}$ a "curve" element. This adds to the flexibility - with same feature/ variable - to map the data points. Please refer page 90, 91 on Introduction to Statistical Learning in R - Hastie, Tibshirani

$\endgroup$
2
  • $\begingroup$ I understand that we are using a non linear fit vs a linear fit. My question is what is the conceptual understanding for displacement$^2$ in words? $\endgroup$
    – user67797
    Commented Jun 20, 2019 at 23:56
  • $\begingroup$ Seems that even Hastie, Tibshirani did not provide answer your query. Also, I'm sure that know the meaning/ difference of x-y relationship in: y = x, y = x$\^2$ curves on a graph. Further ahead, you definitely know what is meaning of x in both graphs/ curves. If you're clear about all of the above, and you've referred the free pdf of book, then I'll curious to see an answer, that resolves your query. Regards. $\endgroup$ Commented Jun 21, 2019 at 1:56
1
$\begingroup$

Generally, I would say that in statistics (and even more so in math in general) it only makes so much sense to look for an intuitive understanding of everything. Sometimes this will just give you a lot of headache while it might be much easier to just take something like, say a function, for what it is: a function. You plug in numbers and get something out (ok, that is not really the formal definition but I hope it gets my point across).

Having said that, for the equation

$efficiency = 2 displacements + displacements^2$

(neglecting the $-4$ here for simplicity) you can actually find an intuitive perspective: The quadratic equation assumes that efficiency increases "more than just linearly" with the number of displacements.

If you have a car $a$ with $displacements_a = 2$ and car $b$ with $displacements_b=4$, then in the linear case of

$efficiency = 2 displacements$

the $efficiency$ of car $a$ would be two times the $efficiency$ of car $b$.

But assuming the above mentioned quadratic relationship means that the number of $displacements$ increases $efficiency$ additionally by the quadratic term. $efficiency$ of car $b$ would now be three times the $efficiency$ of car $a$!

So as you can see from that simple example in the quadratic case any change of the value of $displacements$ has a bigger impact on $efficiency$. And the quadratic term just defines this "more" mathematically.

$\endgroup$
0
$\begingroup$

Your ways of putting coefficient value denotes the relative importance of such variable is wrong. You need to also say that predictor variable is standardized(zero-centred and s.d. of 1) to make it a better argument.

Personally I don't think . If you are discussing this on data science stack exchange we only care about how the relationship between efficiency and fuel. So we start of with prior assumption of $$efficiency = a \cdot displacement^2 + b\cdot displacement + c$$ and how we can find such $a,b,c$ and whether quadratic relationship could be a fit that could also generalize well with our data. Whether or not the relationship makes any sense is subject to people that has better domain expertise to interpret.

Predictor importance reference

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.