Least Squares Error Formula:
From: | To: |
The least squares error measures the discrepancy between observed values (y) and values predicted by a linear model (Xβ). It's the sum of squared differences between actual and predicted values, used in linear regression to find the best-fitting line.
The calculator uses the least squares error formula:
Where:
Explanation: The error is calculated by first computing the predicted values (Xβ), then summing the squared differences between these predictions and the actual values (y).
Details: Least squares error is fundamental in regression analysis, providing a measure of model fit. Minimizing this error yields the optimal coefficients for linear models.
Tips: Enter y as comma-separated values, X as semicolon-separated rows with comma-separated values, and β as comma-separated values. Dimensions must match (X rows = y length, X columns = β length).
Q1: What units does the error have?
A: The error is in squared units of the response variable (y).
Q2: How is this related to R-squared?
A: R-squared is 1 minus (error/total variation), representing proportion of variance explained.
Q3: What if my dimensions don't match?
A: The calculator will show an error. Ensure X has same rows as y length and same columns as β length.
Q4: Can I use this for multiple regression?
A: Yes, the calculator handles multiple predictors through the X matrix.
Q5: What's the difference between error and residual?
A: Residuals are individual differences (y - Xβ), while error is the sum of squared residuals.