Geoscience Reference
In-Depth Information
txt . h ese data have been generated using a series of thirty random levels
(in meters ) below the sediment surface. h e linear relationship age =5.6
meters +20 was used to compute noise-free values for the variable age . h is
is the equation of a straight line with a slope of 5.6 and an intercept with
the y -axis of 20. Some Gaussian noise with a mean of zero and a standard
deviation of 10 has been added to the age data.
clear
rng(0)
meters = 20 * rand(30,1);
age = 5.6 * meters + 20;
age = age + 10.* randn(length(meters),1);
plot(meters,age,'o')
axis([0 20 0 140])
agedepth(:,1) = meters;
agedepth(:,2) = age;
agedepth = sortrows(agedepth,1);
save agedepth_1.txt agedepth -ascii
h e synthetic bivariate data set can be loaded from the i le agedepth_1.txt .
clear
agedepth = load('agedepth_1.txt');
We then dei ne two new variables, meters and age , and generate a scatter plot
of the data.
meters = agedepth(:,1);
age = agedepth(:,2);
plot(meters,age,'o')
axis([0 20 0 140])
In the plot, we can observe a strong linear trend suggesting some
interdependency between the two variables, meters and age . h is trend can
be described by Pearson's correlation coei cient r , where r =1 indicates a
perfect positive correlation (i.e., age increases with meters ), r =0 suggests no
correlation, and r =-1 indicates a perfect negative correlation. We use the
function corrcoef to compute Pearson's correlation coei cient.
corrcoef(meters,age)
which results in the output
ans =
Search WWH ::




Custom Search