H Solutions ch. 3 - Linear models and matrix algebra

Solutions to exercises of chapter 9.

H.1 Example 2

We already know the equation that describes the data very well from high school physics.

\[d = h_0 + v_0 t - 0.5 \times 9.8 t^2\]

with \(h_0\) and \(v_0\) the starting height and velocity respectively. The data we simulated above followed this equation and added measurement error to simulate n observations for dropping the ball \((v_0=0)\) from from height \((h_0=56.67)\)

Here is what the data looks like with the solid line representing the true trajectory:

In R we can fit this model by simply using the lm function.

##              Estimate Std. Error    t value     Pr(>|t|)
## (Intercept) 56.564820  0.6334292  89.299359 1.151246e-29
## tt           0.920082  0.8628641   1.066312 2.978456e-01
## tt2         -5.244192  0.2451271 -21.393764 3.244704e-16

H.2 Example 2

We can see the results of this by computing the estimated \(\hat{\theta}_0+\hat{\theta}_1 x\) for any value of \(x\):

This \(\hat{\boldsymbol{\theta}}=(\mathbf{X}^\top \mathbf{X})^{-1} \mathbf{X}^\top \mathbf{Y}\) is one of the most widely used results in data analysis.