Skip to content

B1uePen/Polynomial_Regression_Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Polynomial_Regression_Analysis

Polynomial Regression with Confidence and Prediction Intervals

This project demonstrates cubic polynomial regression including residual analysis, confidence intervals, and prediction intervals. It shows how to fit a polynomial model to synthetic data and evaluate its quality.

The goal of this project is to generate synthetic data, fit a cubic polynomial regression model, and assess its performance. The project also visualizes confidence and prediction intervals to better understand model uncertainty.

Key steps performed:

  1. Data Generation

    • Created a synthetic dataset with X uniformly distributed between 0 and 10.
    • Generated Y using a cubic polynomial relationship plus normal noise: [ Y = 1 + X - 0.3 X^2 + 0.05 X^3 + \epsilon ]
  2. Polynomial Regression (Degree 3)

    • Estimated polynomial coefficients using Ordinary Least Squares (OLS).
    • Plotted original data points and the regression curve.
  3. Residual Analysis

    • Calculated residuals (differences between observed and predicted values).
    • Plotted:
      • Residuals vs predicted values
      • Histogram of residuals
  4. Confidence and Prediction Intervals

    • Computed 95% confidence intervals for the mean response.
    • Computed 95% prediction intervals for new observations.
    • Visualized both intervals along with the regression curve.

Technologies Used

  • Python 3
  • NumPy (data generation and calculations)
  • Matplotlib (plots and visualization)
  • SciPy (t-distribution for interval estimation)

About

Polynomial Regression with Confidence and Prediction Intervals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors