Processing math: 100%

Load the tumor growth data set from the url http://benzekry.perso.math.cnrs.fr/DONNEES/data_exam.csv into a dataframe

In [24]:
df = read.csv('http://benzekry.perso.math.cnrs.fr/DONNEES/data_exam.csv', sep=";")

Load the time vector in a variable time

Load the volume data in a variable V

1  Linear least-squares

We will first assume a constant error model (i.e. σj=σ,j) and an exponential structural model: V(t;(V0,α))=V0eαt. We can transform the problem so that it reduces to a linear regression.

ln(Vj)=ln(V0)+αtj+σεj

Define a variable y as the log of V

Using the formula seen in class, build the least-squares matrix M for fitting y

Solve the system corresponding to the linear regression

Plot the regression line together with the data

Considering that the number of injected cells is 106 cells, which corresponds to V0=1 mm3, and looking at the fit, what do you conclude about the validity of the exponential model?

The estimate of σ2 is given by s2=1n2nj=1(yjMˆθ)2 with ˆθ the vector of optimal parameters just found and n is the number of time points.

If residuals=yMˆθ is the vector of residuals, then s2 can be computed as s2=1n2residualsTresiduals with residualsT the tranpose of the vector residuals. Using these considerations, compute s2.

Deduce the estimation of the covariance matrix of the parameter estimates, given by s2(MTM)1

Compute the standard errors on the parameter estimates.

Use the built-in ordinary linear least-squares function lm() to verify the results