Geoscience Reference
In-Depth Information
area 0.5*(ʔ
x
ʔ
y
) between the data points and the regression line, where ʔ
x
and ʔ
y
are the distances between the predicted values of
x
and
y
and the
true values of
x
and
y
(Fig. 4.4). Although this optimization appears to be
complex, it can be shown that the i rst regression coei cient
b
1
(the slope) is
simply the ratio of the standard deviations of
y
and
x
.
As with classical regression, the regression line passes through the data
centroid dei ned by the sample mean. We can therefore compute the second
regression coei cient
b
0
(the
y
-intercept),
using the univariate sample means and the slope
b
1
computed earlier. Let us
again load the age-depth data from the i le
agedepth_1.txt
and dei ne two
variables,
meters
and
age
. It is assumed that both of the variables contain
errors and that the scatter of the data can be explained by dispersions of
meters
and
age
.
clear
agedepth = load('agedepth_1.txt');
meters = agedepth(:,1);
age = agedepth(:,2);
h e above formula is used for computing the slope of the regression line
b
1
.
p(1,1) = std(age)/std(meters)
p =
5.6117
h e second coei cient
b
0
, i.e., the
y
-axis intercept, can therefore be computed
by
p(1,2) = mean(age) - p(1,1) * mean(meters)
p =
5.6117 18.7037
h e regression line can be plotted by
plot(meters,age,'o'), hold on
plot(meters,polyval(p,meters),'r'), hold off