Collected while executing every Python case against the library (#274). None of these are errors: every number listed here reproduces. They are places where the book and its companion package have drifted apart in coverage rather than in results, so a reader following the text does not meet the function that exists for the job. Each is an editorial call, hence one issue rather than a pull request.
Solutions given only in R. least-squares-modelling/least-squares-exercises.rst is the largest case. All of these were checked against process_improve and reproduce the quoted figures exactly:
- The prediction intervals at 430, 480 and 520 degrees F (line ~78) are described as "calculating this term manually, or using
predict(model, newdata=, int='p') in R". OLS.prediction_interval returns a Bunch with predicted, lower and upper and gives all three intervals to the printed digits. There is no Python version of this solution today.
- The 1/T model (lines ~118-146), including both standard errors.
- The RMSEP, influence plot and point-removal exercise (lines ~186-198):
OLS with leverage_ and influence_ reproduces the slope, the residual standard error, both confidence intervals and both RMSEP values.
summary-of-steps-to-build-and-investigate-a-linear-model.rst gives steps 2 to 8 only in R. print(OLS().fit(X, y)) renders the summary(lm(...)) layout the steps describe, and conf_intervals_, residuals_, fitted_values_ and prediction_interval cover the rest.
Computed by hand where the library has it.
multiple-linear-regression.rst recomputes adjusted R-squared from R-squared (line ~315); adj_r2_ holds it, and agrees to three decimals.
- The same chapter forms residuals as
y - predict(...); residuals_ holds them, NaN-padded to the original row count so they align with the raw frame.
outliers-...rst fits the same model twice, once with OLS for leverage and Cook's distance and once with statsmodels for the studentized residuals. OLSInfluence supplies all three; alternatively a studentized_residuals_ attribute on OLS would remove the second fit, which is a library request rather than a book one.
univariate-review and process-monitoring do their interval and chart arithmetic with scipy throughout. univariate.t_value, univariate.confidence_interval, monitoring.ControlChart and monitoring.calculate_cpk cover much of it. This is the largest surface and the one where the case for changing is weakest: the chapters are teaching the arithmetic, so showing it explicitly may be the point.
Style, not coverage. Several least-squares blocks pass .values into OLS.fit, which discards the column names the class is built to display; passing the frame makes print(model) show formula: VapourPressure ~ InvTemp3 and label the coefficient row, which is closer to the R output the prose compares against.
Now that every case runs in CI, any of these can be converted with the numbers checked as part of the change.
Collected while executing every Python case against the library (#274). None of these are errors: every number listed here reproduces. They are places where the book and its companion package have drifted apart in coverage rather than in results, so a reader following the text does not meet the function that exists for the job. Each is an editorial call, hence one issue rather than a pull request.
Solutions given only in R.
least-squares-modelling/least-squares-exercises.rstis the largest case. All of these were checked againstprocess_improveand reproduce the quoted figures exactly:predict(model, newdata=, int='p')in R".OLS.prediction_intervalreturns a Bunch withpredicted,lowerandupperand gives all three intervals to the printed digits. There is no Python version of this solution today.OLSwithleverage_andinfluence_reproduces the slope, the residual standard error, both confidence intervals and both RMSEP values.summary-of-steps-to-build-and-investigate-a-linear-model.rstgives steps 2 to 8 only in R.print(OLS().fit(X, y))renders thesummary(lm(...))layout the steps describe, andconf_intervals_,residuals_,fitted_values_andprediction_intervalcover the rest.Computed by hand where the library has it.
multiple-linear-regression.rstrecomputes adjusted R-squared from R-squared (line ~315);adj_r2_holds it, and agrees to three decimals.y - predict(...);residuals_holds them, NaN-padded to the original row count so they align with the raw frame.outliers-...rstfits the same model twice, once withOLSfor leverage and Cook's distance and once withstatsmodelsfor the studentized residuals.OLSInfluencesupplies all three; alternatively astudentized_residuals_attribute onOLSwould remove the second fit, which is a library request rather than a book one.univariate-reviewandprocess-monitoringdo their interval and chart arithmetic withscipythroughout.univariate.t_value,univariate.confidence_interval,monitoring.ControlChartandmonitoring.calculate_cpkcover much of it. This is the largest surface and the one where the case for changing is weakest: the chapters are teaching the arithmetic, so showing it explicitly may be the point.Style, not coverage. Several least-squares blocks pass
.valuesintoOLS.fit, which discards the column names the class is built to display; passing the frame makesprint(model)showformula: VapourPressure ~ InvTemp3and label the coefficient row, which is closer to the R output the prose compares against.Now that every case runs in CI, any of these can be converted with the numbers checked as part of the change.