Artificial intelligent assistant

Linear Regression: linear or reciprocal function? The problem is given below: > Simultaneous values of time $t$ and output $y$ from a specific sensor has been measured and is tabulated below $$\begin{array}{cc} t & y \\\ \hline 1 & 17 \\\ 2 & 15 \\\ 3 & 11 \\\ 4 & 10\\\ 5&8\\\ 6&7\\\ 7&7 \end{array} $$ Determine whether the model $y_1(t) = \beta_0 + \beta_1 t$ or $y_2(t) = \gamma_0 + \gamma_1t^{-1}$ gives the best least squares fit to the data. by having the design matrix and observation vector ![enter image description here]( In the first model I get following beta: $\beta_0=17.71$ and $\beta_1= -1.75$ by the formula: $\beta = (X^TX)^{-1}X^Ty$. My question is then, how to make the design matrix for the second model. the $t^{-1}$ confuse me!

Simply take the second column of your X1 matrix and invert the values, that is it should be $X1(:,2) = [1,1/2,1/3,\ldots,1/7]^T$

Then determine which line gives you a better fit between the two.

It should be noted, this type of regression is sometimes called "Linear Regression With Basis Functions." This concept can add a tremendous amount of flexibility to linear regression and you can get all kinds of neat fits. If you have interest, a simple search of this will give you many interesting articles/presentations/lecture notes on the topic.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 13462174abcb434ef596ce220ee9c450