Regression

  • |

    Scores in Partial Least Squares

    PLS extracts scores as coordinates in a low-dimensional latent space that maximizes the covariance between inputs X and targets Y. That one set of scores reduces dimension, extracts features related to Y, removes multicollinearity, and supports visualization and anomaly detection, which suits sensor and spectral data with many correlated variables.

  • | |

    Ordinary Least Squares

    Fitting a linear regression means solving one matrix equation, not one equation per observation. Stacking the data into a design matrix and minimizing the residual sum of squares gives the normal equation, whose closed-form solution fixes the coefficients uniquely whenever the cross-product matrix can be inverted. NumPy reproduces the computation.

  • | | | |

    TVC (Time-Varying Coefficient) Regression

    Letting a regression coefficient become a function of time fits data where the same predictor matters differently depending on when it was observed. The gain is an effect read straight off its trajectory; the cost is that degrees of freedom grow with the sample, so what ties them together is the real design problem.

  • | | |

    TPLS (Temporal Partial Least Squares)

    PLS regresses and reduces in one step, projecting the predictors along their covariance with the response. Time enters in three distinct places: as lag structure within a sample, as a trajectory treated as its own mode, and as adaptation across arrival. Which place it occupies decides the method and the validation alike.

  • | | |

    Referenced R² — Choosing the Baseline in the R² Denominator

    🇺🇸🇰🇷 R²’s denominator is the error of a baseline, and standard R² fixes that baseline to the dataset mean — which is why one model scores 0.94 on one lot and 0.31 on another at identical RMSE. Swap in a training mean, spec tolerance, or incumbent model, and the metric compares across lots.

  • | | |

    Bayesian R² — Obtaining R² as a Distribution Instead of a Point

    🇺🇸🇰🇷 Standard R² returns a single number with no sense of how firmly it holds. Bayesian R² computes Var_fit / (Var_fit + Var_res) for every posterior draw, yielding a distribution bounded in [0, 1] — a median plus a credible interval. Covers the Gelman formulation, both residual-variance variants, applicable models, and common pitfalls.

  • | | |

    Centered R² vs Uncentered R²

    🇺🇸🇰🇷 Centered R² measures variance explained relative to the mean, while uncentered R² measures agreement relative to zero. This article compares the two, derives the uncentered form from the orthogonality of residuals, reads both as angles between vectors, and argues that uncentered R² is the better metric for judging 1:1-line agreement on same-unit data.

  • | | |

    Regression Metrics

    🇺🇸🇰🇷 Regression metrics split into three families: variance-based indices that track the trend, mean-based indices that measure absolute distance, and agreement indices that demand both at once. Read against the 1:1 line, each family answers a different question, and the variance-based ones collapse when the target range is narrow.