Geoscience Reference
In-Depth Information
h is linear i t dif ers slightly from the line obtained from classical regression.
Note that the regression line from RMA is not the bisector of the lines
produced by the x - y and y - x classical linear regression analyses, i.e., those
produced using either x or y as an independent variable while computing
the regression lines.
4.9 Curvilinear Regression
It is apparent from our previous analysis that a linear regression model
provides a good way of describing the scaling properties of the data. However,
we may wish to check whether the data could be equally well described by a
polynomial i t of a higher degree, for instance by a second degree polynomial:
To clear the workspace and reload the original data, we type
clear
agedepth = load('agedepth_1.txt');
meters = agedepth(:,1);
age = agedepth(:,2);
A second degree polynomial can then be i tted by using the function polyfit .
p = polyfit(meters,age,2)
p =
0.0589 4.1087 26.0381
h e i rst coei cient is close to zero, i.e., has little inl uence on predictions.
h e second and third coei cients are similar to those obtained by linear
regression. Plotting the data yields a curve that resembles a straight line.
plot(meters,age,'o'), hold on
plot(meters,polyval(p,meters),'r'), hold off
Let us compute and plot the error bounds obtained by using an optional
second output parameter from polyfit as an input parameter to polyval .
[p,s] = polyfit(meters,age,2);
[p_age,delta] = polyval(p,meters,s);
As before, this code uses an interval of ±2 s , corresponding to a 95% coni dence
interval. Using polyfit not only yields the polynomial coei cients p , but also
a structure s for use with polyval to obtain error bounds for the predictions.
Search WWH ::




Custom Search