Linear Regression: Forecasting with a Straight Line

Linear regression forecasts the future by drawing a straight line through past data. It's used to predict outcomes like sales based on ad spend or energy use based on temperature.
WHY IT EXISTS: Businesses need to plan for the future, from inventory and staffing to budget allocation. To do this, they need a simple, interpretable way to estimate future outcomes based on known factors. Linear regression provides a foundational method for creating these forecasts by identifying and quantifying the relationships between variables.
THE MENTAL MODEL: Imagine plotting your historical data on a scatter plot, like monthly sales versus advertising spend. Linear regression is the process of finding the single straight line that best cuts through that cloud of points. This line represents the underlying relationship. To make a forecast, you just find a future point on that line based on a predicted input value, like "if we spend 10k on ads next month, the line predicts we'll make 50k in sales."
HOW IT WORKS: The model defines a forecast variable (y) as a linear combination of one or more predictor variables (x). The formula is y = b0 + b1*x1 + b2*x2 + ... + e, where 'b' values are coefficients (weights) and 'e' is the error term. The algorithm, typically "least squares estimation," calculates the coefficient values that minimize the total squared distance between the actual data points and the regression line. Once these coefficients are found, you can plug in future values for your predictors (x) to get a forecast for y.
WHEN TO USE IT: Use linear regression when you have a good reason to believe a linear relationship exists between your predictors and the outcome. It's excellent for simple, explainable forecasts. For example, forecasting a company's revenue based on its user growth, or predicting crop yield based on rainfall and fertilizer amount. It's often the first model you should try because of its simplicity and interpretability.
WHEN NOT TO USE IT: Avoid linear regression when the underlying relationship is clearly not linear, like user growth that follows an S-curve. It's also a poor choice for data with strong seasonality or complex time-series patterns that it can't capture on its own without special predictor variables. Most importantly, if your predictors are not actually driving the outcome, the model will produce garbage forecasts.
ONE CANONICAL EXAMPLE: A company wants to forecast its monthly ice cream sales (y). They know that sales are heavily influenced by the average monthly temperature (x). They gather data for the past 24 months and fit a linear regression model. The model finds the line: Sales = -500 + 100 * Temperature. This means for every 1-degree increase in temperature, sales are predicted to increase by 100. If next July's forecast temperature is 30 degrees, the model predicts sales of -500 + 100 * 30 = 2,500.
Read the original → otexts.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.