Choosing Between Linear and Nonlinear Models – Simple Example
Below is a concrete example illustrating the practical choice between linear and nonlinear models, using the case of marketing campaigns and sales prediction.
Step 1: Testing with a Simple Linear Model
Objective:
Predict the relationship between advertising expenses and sales.
Example Data:
Month | Advertising Cost (10,000 yen) | Sales (10,000 yen) |
---|---|---|
Jan | 10 | 150 |
Feb | 20 | 300 |
Mar | 30 | 450 |
Apr | 40 | 550 |
May | 50 | 600 |
Building the Linear Model
Assuming a proportional relationship where sales increase linearly with advertising expenses:
Sales = a × Advertising Cost + b
Step 2: Identifying the Limitations of the Linear Model
As more data is collected, the following trend becomes evident:
Advertising Cost (10,000 yen) | Sales (10,000 yen) |
---|---|
60 | 620 |
70 | 630 |
80 | 635 |
This new data cannot be explained by the initially assumed linear model.
Problem: Saturation Effect
- At first, advertising is effective.
- As investment increases, the marginal effect diminishes.
- A linear model falsely predicts unlimited growth in sales, which does not reflect reality.
Step 3: Transition to a Nonlinear Model
To capture the saturation effect, we introduce a nonlinear, exponentially decaying model:
Sales = Maximum Sales × (1 - e^(-k × Advertising Cost))
About the Exponential Function
- If the exponent has a positive coefficient (growth model), the output increases exponentially over time or with increased input.
- If the exponent has a negative coefficient (decay model), the output rapidly decreases and approaches saturation.
- This allows for realistic modeling of diminishing returns on advertising investment.
Features of Nonlinear Models
A major advantage of nonlinear models is their ability to accurately reproduce realistic saturation effects, such as those seen in advertising campaigns. For instance:
- Initially, increasing advertising significantly boosts sales.
- Beyond a certain investment level, the effect gradually weakens.
- Eventually, additional investment yields little to no sales growth.
By using a nonlinear model, it becomes possible to:
- Quantitatively identify the point where the advertising effect saturates.
- Estimate the optimal advertising budget to maximize returns while avoiding unnecessary expenses.
Choosing Between Linear and Nonlinear Models – Explainability Perspective
Another practical example of choosing between linear and nonlinear models is based on the perspective of explainability.
For instance, consider the relationship between sales and advertising expenses represented by the following simple linear model:
y = 2 × Advertising Cost + 3 × Number of SNS Posts + 5
In this model, the “weights” (coefficients) directly indicate the influence of each feature, making it possible to interpret exactly how much the output will change when a particular variable changes by one unit.
In contrast, suppose we use a more complex model, such as a neural network, designed with the following inputs and output:
Inputs:
- Advertising cost
- Number of SNS mentions
- Seasonal factors
- Competitor activity
Output:
- Sales prediction
While such a model can achieve higher prediction accuracy, the relationship between inputs and outputs becomes a “black box,” making it difficult to explain precisely how changes in specific inputs affect the predicted sales. As a result, decision-makers may find it challenging to apply the model effectively.
Improving Explainability in Nonlinear Models
To address this challenge, it is common to apply explainability techniques such as SHAP, LIME, or Feature Importance Visualization after analyzing the data with a nonlinear model.
- SHAP and LIME allow visualization of feature importance.
- These tools provide an “add-on” layer of explainability to complex nonlinear models, making them behave more like interpretable linear models.
In other words, these explainability techniques help bridge the gap by bringing some of the interpretability benefits of linear models to nonlinear models.
Practical Workflow Example
- First, apply a simple linear model to gain a quick understanding of the results and easily share insights within the team.
- Next, introduce a more complex nonlinear model to capture intricate patterns and improve prediction accuracy.
- Finally, use tools like SHAP or LIME to supplement the nonlinear model with interpretability, allowing for clearer decision-making.
Thus, the best approach is to adaptively use both the simplicity and explainability of linear models and the expressive power of nonlinear models, depending on the situation.
コメント