Optimizing Regression Degree with Weighted Cost Function

  • Context: Undergrad 
  • Thread starter Thread starter andrewcheong
  • Start date Start date
  • Tags Tags
    Regression Smooth
Click For Summary
SUMMARY

The discussion focuses on optimizing regression degree using a weighted cost function in polynomial fits. The user seeks a method to balance low residual errors with a low degree of regression when fitting a set of N (x,y) points. They highlight that while a perfect fit can be achieved with a degree of N-1, this approach is impractical due to overfitting. The suggested solution involves introducing a weight function, W=c1·deg p + c2·μ, to minimize the cost associated with regression degree and error margins.

PREREQUISITES
  • Understanding of polynomial regression and its degrees
  • Familiarity with residual error analysis
  • Knowledge of cost functions in optimization
  • Basic concepts of weight functions in statistical modeling
NEXT STEPS
  • Research techniques for selecting optimal regression degrees, such as the Akaike Information Criterion (AIC)
  • Learn about regularization methods like Lasso and Ridge regression to prevent overfitting
  • Explore the application of B-splines in regression analysis
  • Investigate error metrics and their scaling for regression models
USEFUL FOR

Data scientists, statisticians, and financial analysts interested in optimizing regression models for predictive analytics, particularly in stock market analysis.

andrewcheong
Messages
8
Reaction score
0
Hello, all. I know what I want, but I just don't know what it's called.

This has to do with regression (polynomial fits). Given a set of N (x,y) points, we can compute a regression of degree K. For example, we could have a hundred (x,y) points and compute a linear regression (degree 1). Of course, there would be residual error because the line-of-best-fit won't go through every point perfectly. We could also compute quadratic (degree 2) or higher-degree regressions. This should reduce the residual error, or at least, be no worse an estimate than the lower-degree regressions.

Now, what I want is a regression that determines the "best degree". I mean, if I have N points, I can always get a perfect fit by computing a regression of degree N-1. For example, if I only have 2 points, a 1-degree regression (linear) can fit both points perfectly. If I only have 3 points, a 2-degree regression (quadratic) can fit all three points perfectly, etc. So if I have a 100 points, one might say that a 99-degree regression is the "best degree". However, I look at higher-degrees as a cost.

I want a method of determining a regression with a balance between low residual errors and low degree. I imagine that there must be some sort of a "cost" parameter that I have to set, because the computer alone cannot say what the "right" balance between residual error and degree is.

Can anyone point me to the name of such a technique? Perhaps the most common used form of it?

I want to apply this to stock market prices. As human beings, we can look at a plot of stock prices and mentally "fit" a smooth curve across the points that makes sense. But how does a computer do this? We can't just tell it to do a perfect fit, because then it'll do an N-1 degree fit (e.g. cubic B-splines).

Thanks in advance!
 
Physics news on Phys.org
You can introduce a weight function: ##W=c_1\cdot \deg p + c_2 \cdot \mu## and minimize it. Of course you will first have to choose an appropriate measure ##\mu## to scale your error margins.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 23 ·
Replies
23
Views
4K
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K