Error in linear Algebra !!

Ax=B

x=inv(A)*B

or

x=B\A

Both MATLAB commands return the same x.

______--

HOMEWORK HANDOUT

______

Naomi asked a very good question recently—how do you put confidence limits on a lagged covariance plot. This is done by hypothesis testing where the null hypothesis is that there is no correlation—and the null hypothesis is rejected where the correlation coefficient exceeds a defined confidence level.

In hypothesis testing two types of errors are possible.

In type-1 errors the null hypothesis is rejected when the null hypothesis is true and the probability of this error is denoted by (Here we would say that the correlation is significant when it is not)

In type-2 errors occur then the null hypothesis is accepted when it is in fact false (here we say the correlation is not significant when in fact it is. The probability of type-2 errors are 

Testing the significance levels for correlation coefficient.

We choose the rejection region in terms of r at a chosen significant level for different degrees of freedom (N-2). (Use Appendix E not C!!). This shows the significance levels for the degrees of freedom for the 5% and 1% confidence limits.

The procedure for finding confidence intervals for the correlation coefficient r is to transform it into the standard normal variable Zr

Zr=.5*(ln(1+r)-ln(1-r));

Which has the standard error

The appropriate confidence interval is then

Zr-Zz<Z< Zr+Zz

So if your normalized correlation coefficient Z is less than Zz then you can’t say within the prescribed confidence limits that your estimate of the correlation coefficient is different from zero. In other words you can’t say that the data sets are correlated.

To transform this back to r call Zz =C

C<.5*(ln(1+r)-ln(1-r))

Example,

What would the confidence limit for 95% confidence limit test for significance for 30 degrees of freedom?

From the Guassian Distribution

Z

=1/sqrt(27)=.1925

Z.05/2=1.96

zZ.05/2=.3772=C

Transform this back to r with above equation requires that the correlation needs to be above 0.36 to be significant.

You can also just look up this value in appendix E in Emery and Thompson (however, I’m getting slightly different answers—for example in the above example while both the book and this calculation agree—for 8 degrees of freedom (N=10) I calculate a significance level of .630, while the book reports .632)

Before going back into Fourier Analysis—I want to talk about ellipses—it’ll be a good review of complex numbers, and it’s very useful when applying the least-squares fitting that we have been applying to a scaler time series. When LSQ fitting is performed to a vector time series, such as current or wind measurements—it is extremely useful to characterize the periodic motion in terms of its ellipse. Since I’m an oceanographer I’ll refer this to as the tidal ellipse—can be used for inertial motion which occurs in ocean and atmosphere—but probably not in the geochemical record.

Tidal ellipse

U=Acost+Bsint

V=Ccost+Dsint

R=u+iv

R= Acost+Bsint+i (Ccost+Dsint)

R=(A+iC) cos(B+iD) sint

Since we are dealing with vector that oscillates at a single frequency this can be represented in terms of a clockwise rotating vector and a counter clockwise rotating vector.

i.e.

R=R+eit+ R-e-it

Where R+ and R- are the radii of the clockwise and counter-clockwise rotating constituents.

Recall

eit=cost+isint

so

R= R+( cost+isint) + R-( cost-isint)

R=( R++ R-) cost +i( R+- R-) sint

Solving for R+ and R- by equating the two bold equations above we find:

The magnitude of these are then

Now the amplitude of the Major Axis is R++ R- And the amplitude of the minor axis is R+- R-

While the orientation and phase of the ellipses:

G1=180*atan2(B1,A1)/pi;

G2=180*atan2(B2,A2)/pi;

OREN= 0.5*(G1+G2);

PHASE=0.5*(G2-G1);

Fourier

Note relationship between discrete Fourier transform and correlation. If there is a correlation between a sinusoid and the data this operation will yield a higher value than one where the correlation is weak. For the correlation to be large requires that the signal have some energy at this frequency. Since the Fourier components are orthogonal each component will uniquely pick up a correlation with the signal. The sum of these coefficients then completely describes the signal.

The Complex Conjegent

Cn= C*-n

Z=x+iy;

Z*=x-iy;

Z Z*=(x+iy)(x-iy)=x2+y2

MATLAB

Z*conj(Z)

For element-by-element vector or matrix multiplication

Z. *conj(Z)

This is useful when taking spectra in MATLAB

Gate Function

=1 –1/2 < x < ½

=0 elsewhere

Extend F.T. to Generalized functions

Write slightly differently (integral goes from –T/2 to T/2)

The Gate Function (this is the sampling record)

Sinc function

Now consider a gate function that has the same area but the time that it is non zero is 1/T

1/T * GATE(t/T)

So as it gets shorter it gets taller, but the integral remains the same.

The Fourier Transform of this is

1/T * GATE(t/T)

Draw this as Gate, with T=2, showing gate narrowing and bringing the function to the Dirac delta function

Finally the Fourier transform of a Gated Sinwave

SEE YELLOW PAD.

Fast Fourier Transform

Note the number of operations to do discrete Fourier Transform.

Power Spectra

1