ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalMS-251Least Squares Fitted M…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    MS-251

    Probability and Statistics

    Progress0 / 36 done
    Topics36
    1Statistics and Data Analysis2Statistical Inference3Samples, Populations, and the Role of Probability4Sampling Procedures5Discrete and Continuous Data6Statistical Modeling7Types of Statistical Studies
    8Sample Space, Events, Counting Sample Points9Probability of an Event10Additive Rules11Conditional Probability12Independence and the Product Rule13Bayes’ Rule14Random Variables and Probability Distributions
    15Mean of a Random Variable16Variance and Covariance of Random Variables17Means and Variances of Linear Combinations of Random Variables18Chebyshev’s Theorem19Discrete Probability Distributions20Continuous Probability Distributions21Fundamental Sampling Distributions22Sampling Distributions and Data Descriptions23Random Sampling24Sampling Distributions25Sampling Distribution of Means and the Central Limit Theorem26Sampling Distribution of S227t-Distribution28F-Quantile and Probability Plots29Single Sample & One- and Two-Sample Estimation Problems30Single Sample & One- and Two-Sample Tests of Hypotheses31The Use of P-Values for Decision Making in Testing Hypotheses
    32Linear Regression and Correlation33Least Squares and the Fitted Model34Multiple Linear Regression and Certain Nonlinear Regression Models35Linear Regression Model Using Matrices36Properties of the Least Squares Estimators
    10 min read
    Topic 33 of 36
    Topic Study Note Illustration
    33

    Least Squares and the Fitted Model

    In statistical modeling, particularly in linear regression , the least squares method is a technique used to estimate the parameters of a linear regression model. The objective...

    Least Squares and the Fitted Model

    In statistical modeling, particularly in linear regression, the least squares method is a technique used to estimate the parameters of a linear regression model. The objective is to find the line (or hyperplane in higher dimensions) that minimizes the sum of the squared differences between the observed values and the values predicted by the model. This line is known as the fitted model or regression line.

    Let's break down the concept of least squares and how it leads to the fitted model.


    1. The Least Squares Method

    The least squares method is used to find the best-fitting line by minimizing the sum of squared residuals. Residuals are the differences between the observed values (YiY_iYi​) and the predicted values (Y^i\hat{Y}_iY^i​) from the regression line. In simple linear regression, the goal is to estimate the parameters (slope Ξ²1\beta_1Ξ²1​ and intercept Ξ²0\beta_0Ξ²0​) of the linear model:

    Yi=Ξ²0+Ξ²1Xi+Ο΅iY_i = \beta_0 + \beta_1 X_i + \epsilon_iYi​=Ξ²0​+Ξ²1​Xi​+Ο΅i​

    Where:

    • YiY_iYi​ are the observed values,
    • XiX_iXi​ are the values of the independent variable,
    • Ξ²0\beta_0Ξ²0​ is the intercept,
    • Ξ²1\beta_1Ξ²1​ is the slope,
    • Ο΅i\epsilon_iΟ΅i​ is the error term (residual).

    The residual for each data point iii is given by:

    ei=Yiβˆ’Y^i=Yiβˆ’(Ξ²0+Ξ²1Xi)e_i = Y_i - \hat{Y}_i = Y_i - (\beta_0 + \beta_1 X_i)ei​=Yiβ€‹βˆ’Y^i​=Yiβ€‹βˆ’(Ξ²0​+Ξ²1​Xi​)

    2. Objective of Least Squares

    The objective of the least squares method is to minimize the sum of squared residuals, which is mathematically expressed as:

    SSE=βˆ‘i=1n(Yiβˆ’Y^i)2\text{SSE} = \sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2SSE=i=1βˆ‘n​(Yiβ€‹βˆ’Y^i​)2

    Where:

    • SSESSESSE stands for Sum of Squared Errors (or residual sum of squares).
    • nnn is the number of data points.

    The least squares method minimizes SSESSESSE by adjusting the parameters Ξ²0\beta_0Ξ²0​ (intercept) and Ξ²1\beta_1Ξ²1​ (slope) of the linear equation.

    3. Estimating the Parameters Ξ²0\beta_0Ξ²0​ and Ξ²1\beta_1Ξ²1​

    Using calculus, we can find the values of Ξ²0\beta_0Ξ²0​ and Ξ²1\beta_1Ξ²1​ that minimize the sum of squared residuals. These values are computed as follows:

    a. Formula for Ξ²1\beta_1Ξ²1​ (Slope)

    The slope Ξ²1\beta_1Ξ²1​ is given by the formula:

    Ξ²1^=nβˆ‘i=1nXiYiβˆ’βˆ‘i=1nXiβˆ‘i=1nYinβˆ‘i=1nXi2βˆ’(βˆ‘i=1nXi)2\hat{\beta_1} = \frac{n \sum_{i=1}^{n} X_i Y_i - \sum_{i=1}^{n} X_i \sum_{i=1}^{n} Y_i}{n \sum_{i=1}^{n} X_i^2 - \left( \sum_{i=1}^{n} X_i \right)^2}Ξ²1​^​=nβˆ‘i=1n​Xi2β€‹βˆ’(βˆ‘i=1n​Xi​)2nβˆ‘i=1n​Xi​Yiβ€‹βˆ’βˆ‘i=1n​Xiβ€‹βˆ‘i=1n​Yi​​

    Where:

    • Ξ²1^\hat{\beta_1}Ξ²1​^​ is the estimated slope,
    • XiX_iXi​ and YiY_iYi​ are the individual data points,
    • nnn is the number of data points.

    b. Formula for Ξ²0\beta_0Ξ²0​ (Intercept)

    Once the slope Ξ²1^\hat{\beta_1}Ξ²1​^​ is found, the intercept Ξ²0\beta_0Ξ²0​ can be estimated as:

    Ξ²0^=YΛ‰βˆ’Ξ²1^XΛ‰\hat{\beta_0} = \bar{Y} - \hat{\beta_1} \bar{X}Ξ²0​^​=YΛ‰βˆ’Ξ²1​^​XΛ‰

    Where:

    • XΛ‰\bar{X}XΛ‰ is the mean of the independent variable XXX,
    • YΛ‰\bar{Y}YΛ‰ is the mean of the dependent variable YYY.

    Thus, the fitted model (regression line) is given by:

    Y^=Ξ²0^+Ξ²1^X\hat{Y} = \hat{\beta_0} + \hat{\beta_1} XY^=Ξ²0​^​+Ξ²1​^​X

    This is the fitted regression line that minimizes the sum of squared errors.


    4. The Fitted Model: The Regression Line

    The fitted model refers to the regression equation obtained after applying the least squares method. The line of best fit is the line that minimizes the difference between the observed values YiY_iYi​ and the predicted values Y^i\hat{Y}_iY^i​. The fitted model is represented by the equation:

    Y^=Ξ²0^+Ξ²1^X\hat{Y} = \hat{\beta_0} + \hat{\beta_1} XY^=Ξ²0​^​+Ξ²1​^​X

    Where:

    • Y^\hat{Y}Y^ is the predicted value of YYY,
    • XXX is the independent variable,
    • Ξ²0^\hat{\beta_0}Ξ²0​^​ is the estimated intercept,
    • Ξ²1^\hat{\beta_1}Ξ²1​^​ is the estimated slope.

    The fitted line is used to make predictions about the dependent variable YYY for any given value of XXX. For example, if XXX represents years of experience, and YYY represents salary, the fitted model can predict the expected salary for any given number of years of experience.

    Example of Fitted Model:

    Let’s say we have a dataset that represents the relationship between the number of study hours (XXX) and the test scores (YYY) of a group of students. After performing linear regression, we obtain the fitted model:

    Y^=50+5X\hat{Y} = 50 + 5XY^=50+5X

    This means that for each additional hour of study (XXX), the test score (YYY) increases by 5 points. The intercept of 50 suggests that a student who does not study at all (X=0X = 0X=0) is expected to have a baseline test score of 50.


    5. Assessing the Fit of the Model

    Once the least squares method is used to estimate the parameters, it’s important to assess how well the fitted model represents the data. This can be done using several metrics:

    a. Residuals

    Residuals are the differences between the observed values and the predicted values:

    ei=Yiβˆ’Y^ie_i = Y_i - \hat{Y}_iei​=Yiβ€‹βˆ’Y^i​

    By examining the residuals, we can check the assumptions of the regression model, such as homoscedasticity (constant variance) and independence of errors.

    b. R2R^2R2 (Coefficient of Determination)

    R2R^2R2 is a key metric that tells us how well the fitted model explains the variability in the dependent variable. It is the proportion of the variance in the dependent variable that is explained by the independent variable.

    R2=1βˆ’βˆ‘i=1n(Yiβˆ’Y^i)2βˆ‘i=1n(Yiβˆ’YΛ‰)2R^2 = 1 - \frac{\sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2}{\sum_{i=1}^{n} (Y_i - \bar{Y})^2}R2=1βˆ’βˆ‘i=1n​(Yiβ€‹βˆ’YΛ‰)2βˆ‘i=1n​(Yiβ€‹βˆ’Y^i​)2​

    Where:

    • YiY_iYi​ are the observed values,
    • Y^i\hat{Y}_iY^i​ are the predicted values,
    • YΛ‰\bar{Y}YΛ‰ is the mean of YYY.

    An R2R^2R2 value close to 1 indicates that the model explains most of the variance in the data, while an R2R^2R2 value close to 0 suggests that the model does not explain much of the variance.

    c. Hypothesis Testing for Parameters

    In addition to the fitted model, hypothesis tests can be performed on the parameters Ξ²0\beta_0Ξ²0​ and Ξ²1\beta_1Ξ²1​ to assess whether they are statistically significantly different from zero. Typically, this is done using t-tests for the individual regression coefficients.


    6. Limitations of the Fitted Model

    While the least squares method provides a useful tool for fitting a linear regression model, there are some important limitations:

    • Linearity Assumption: Linear regression assumes a linear relationship between the independent and dependent variables. If the relationship is non-linear, a linear regression model may not provide a good fit.
    • Outliers: Outliers can significantly affect the fitted model, especially in small datasets.
    • Assumption of Homoscedasticity: The least squares method assumes constant variance of the residuals. If the variance of residuals changes with the independent variable, this assumption is violated (heteroscedasticity).
    • Multicollinearity: In multiple regression, high correlation between independent variables can lead to instability in the coefficient estimates.

    Summary

    • The least squares method is used to estimate the parameters (slope and intercept) of a linear regression model by minimizing the sum of squared residuals.
    • The fitted model represents the best-fitting line, which can be used for prediction and analysis.
    • Key metrics for assessing the fit of the model include residuals, R2R^2R2, and hypothesis tests for the regression coefficients.
    • Understanding the assumptions and limitations of the model is essential for accurate interpretation and use of the regression results.
    ← Previous topic 32
    Regression: Linear Regression and Correlation
    Next topic 34 β†’
    Multiple Linear Regression and Certain Nonlinear Regression Models

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    10mremaining
    1.8kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Probability and Statistics