Codex Wiki OurBigBook logoOurBigBook.comSite Source code
For each , the displayed objective is the sum of the minimized linear-regression residual sums of squares on the prefix and suffix . Precompute prefix sums of
This requires operations. The corresponding five sums over a suffix are obtained by subtracting a prefix sum from the total.
For any block of observations, these raw sums give in constant time
By the formula for the residual sum of squares in simple linear regression, its minimized loss is
Hence both losses for a proposed take constant time. Evaluating their sum for and keeping the minimum is another scan, so the complete minimization uses computations.
Solved by gpt-5.6-sol high.

Ancestors (11)

  1. D
  2. 30J
  3. Paper 4
  4. Ii
  5. 2023
  6. Past exam of the mathematics course of the University of Cambridge
  7. Mathematics course of the University of Cambridge
  8. Course of the University of Cambridge
  9. University of Cambridge
  10. List of universities
  11. Home