> ./load-posts-daily-blog-Fri-Jul-31-2026-2026-07-31T13:35:36-04:00.sh

> initializing personal vitals and stats...

> ./load-health-stats.sh

+------------------------------+---------------+----------------+
| ===========================Sleep=============================|
+------------------------------+---------------+---------------+
| Quality                      | Duration      | Notes         |
+------------------------------+---------------+---------------+
|okay                          |8 hours        |Nothing remarka|
| =========================Exercise============================|
+---------------+---------------+------------------------------+
| Activity      | Duration      |            Notes             |
+---------------+---------------+------------------------------+
|walking the dog|10 minutes     |Practicalitality              |
| ======================Required Medications===================|
+--------------------------+--------------------------+--------+
| Name                     | Dosage                   | Taken  |
+--------------------------+--------------------------+--------+
|Montelukast               |10 mg                     |Yes     |
|Ompeperazole              |40 mg                     |Yes     |
|Advair-Morning            |50 mcg                    |Yes     |
|Advair-Night              |50 mcg                    |No      |
|Fiber                     |                          |Yes     |
|Miralax                   |                          |No      |
|Vitamin D                 |                          |No      |
| ==========================Medications========================|
+-------------------------------+------------------------------+
| Name                          | Dosage                       |
+-------------------------------+------------------------------+
|GABA                          |750 mg                        |
|L Theanine                    |100 mg                        |
| =============================================================|

> retrieving posts@July 31, 2026...

Daily Blog - July 31, 2026

Today we planned on going out Sparking but didnt’ wake up in time. So we just went to the Drs appointment at 10. Then we went to the store, and now we’re home, and I’m reading more ISLR~!

After that I went to donate plasma.

Then I cooked dinner. Chicken parm and spaghet. It’s easy. After eating dinner I played some Helldivers.

ISLR Notes

7.4 Regression Splines

Now we are going to explore a pretty neat, flexable class of basis functions that builds upon the polynomial regression and piecewise constant regression approaches we already learned.

7.4.1 Piecewise Polynomials

Piecewise polynomials is a combination of polynomial regression and piecewise constant regression. Instead of trying to fit a high-degree polynomial to the data, we fit several separate low-degree polynomials over different regions of $X$.

For example, if you want to fit a piecewise cubic polynomial you’d start with an ordinary cubic polynomial

$$ y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2 + \beta_3 x_i^3 + \epsilon_i $$

You would allow the coefficients $\beta_0$, $\beta_1$, $\beta_2$, $\beta_3$ to change in different parts of the range of $X$. The points where the coefficients change are called knots.

Then if you want to fit it over two regions with the knot at c:

$$ y_i = \begin{cases} \beta_{01} + \beta_{11}x_i + \beta_{21}x_i^2 + \beta{31}x_i^3 + \epsilon_i & \text{if } x_i \lt c \cr \beta_{02} + \beta_{12}x_i + \beta_{22}x_i^3 + \beta{32}x_i^3 + \epsilon_i & \text{if } x_i \geq c \cr \end{cases} $$

Like with the step function, you can do as many knots as needed. There’s usually some structure lost around the knots, but by picking good values along the range you can mitigate it somewhat.

7.4.2 Constraints and Splines

The basis functions don’t always fit exactly at the knots. Sometimes the values are nowhwere near eachother! Fear not! We can use a few methods to constrain the polynomial functions so that the fitted curve is continuous. If we add one more constraint, smoothness, we get what’s called the cubic spline. This curve has 3 constraints (technically smoothness is two constraints, on the first AND second derivative of the function), and each constraint effectively frees up a degree of freedom by reducing the complexity of the resulting piecewise polynomial fit. So we are left with 5 degrees of freedom. In general, a cubic spline with $K$ knots uses a total of $4 + K$ degrees of freedom. Also, a degree-d spline is a piecewise dsegree-d polynomial, with continuity in derivatives up to degree $d - 1$ at each knot.

.> /load-comments-daily-blog-Fri-Jul-31-2026-linux-x64.sh

comments powered by Disqus