A mechanistic model for the relationship between x and y sometimes needs parameter estimation. When model linearisation does not work,we need to use non-linear modeling.
There are three main differences between non-linear and linear modeling in R:
1. Specify the exact nature of the equation.
2. Replace the
nls(), which means non-linear least squares.
3. Sometimes we also need to specify the model parameters a, b and c.
In this exercise, we will use the same data-set as the previous exercise in polynomial regression here. Download the data-set here.
A quick overview of the data-set:
Response variable = number of invertebrates (INDIV)
Explanatory variable = the area of each clump (AREA)
Additional possible response variables = Species richness of invertebrates (SPECIES)
Answers to these exercises are available here. If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.
Load the data-set; specify the model. Try to use the power function with
nls() and a=0.1 and b=1 as the initial parameter number.
Do a quick check by creating a plot residual vs. a fitted model, since a normal plot will not work.
Try to build a self-start function of the powered model.
Generate the asymptotic model.
Compared the asymptotic model to the powered one using AIC. What can we infer?
Plot the model in one graph.
Predict across the data and plot all three lines.