552 Software Library
Here is some software you can play with in MatLab.
If you shift-click, it should be like an ftp and you can store the file on your local computer, in the directory where you will run Matlab. If you just click on the link, it will display the program in your browser.
If this does not work, you can also go to the public ftp directory: ftp eos.atmos.washington.edu/pub/dennis/552_Class and copy the files into the directory where you want to run MatLab.
Monte Hall Three-Door Problem statistical Test: Does a brute force test of the proposition.
Illustration of Column Space: A program to make a data set in three-space of two orthogonal vectors and SVD it.
Autocorrelation Function: A program to calculate autocorrelation.
Two-Dimensional Eigenvector Illustration: A program to make a two dimensioal data set, do EOF analysis, and plot a scatter diagram of the data and the corresponding EOFs.
Homework #4 Intro EOF-Analysis: Does EOF analysis of a couple canned data sets.
Generation of Red Noise: Make some red noise time series with specified autocorrelation at one sample interval, plot a sample of the time series to look at, then compute the power spectra associated with these two time series. Notice how red noise looks and how its spectrum looks. Play with the autocorrelation to see how it affects the look of the time series and the power spectrum. Play with the parameters.
EOF Analysis of Red Noise: Sample red noise with a specified spatial autocorrelation from a limited spatial domain. Look at how the eigenvectors depend on the size of the domain and the spatial autocorrelation. Note that, when the domain of state space is small compared to the autocorrelation distance, you can get seemingly significant EOFs that look like a Fourier series, but they are rubbish. Play with the parameters.
Scaling of Eigenvectors: A program to make a two dimensioal data set, do EOF analysis, and scale the EOFs. It includes options for normalizing the data or not prior to analysis. You can also vary the amplitude of the noise.
svdscale.m does exactly the same thing as eofscale.m, except that it uses the SVD algorithm operating on the data matrix to get the eofs and eigenvalues. You will note that the two algorithms order the eigenvalues/vectors back to front and front to back, respectively. Why, I don't know, but this is all accounted for in these programs and they should produce good results on your first try. Cheers.
Updated with new features in 2012
You need to put this file in the directory, too. It allows default values to be specified on keyboard input.
Rotation of Eigenvectors: ROTRED generates a data set consisting of red noise in space plus Gaussian shapes located at points 8, 20, and 29 on the x axis. These vary with time with periods of 20, 25, and 24 days, respectively. If you run this with the recommended parameters, it will give you somewhat sinusoidal eigenvenctors, but the rotated ones will look like the isolated Gaussian shapes that were put in. The recommended parameters are given as the first number in parentheses, when the input is requested. Use these the first time, then play with the parameters. The rotation does not work well if the data set is just noise. You need to place the EOF rotation software, varimax.m, in the directory, too.
rotsquare.m looks at square waves in space with sinusoidal time variation and weak noise.
You need to put these files in the directory, too. They are the rotation software function and something to allow default values to be specified.
varimax.m . . inputwd.m
Maximum Covariance Analysis: MCA.m generates a data set consisting of some noise plus some signals. On signal dominates the variance and the other dominates the covariance. The program does a full EOF analysis of two data sets, then computes the SVD of the covariance matrix between the two data sets, plots the singular value spectrum with the Root Mean Square Covariance Fraction of the two data sets. If you activate the reading of the external data sets and eliminate the calculation of the data sets for this example, the program will also do the MCA homework problem. This was updated in 2013 to include heterogeneous and homogeneous regressions.
You need to put this file in the directory, too. inputwd.m
Sampling of Red Noise Spectra: RRSPEC generates red noise data and computes and plots spectra with sample sizes ranging from one to a large number at intervals that you specify. The first time through just press the return key repeatedly and watch the spectrum evolve. The idea is to watch the noise decrease and the 99% significance level come down as the sample size and degrees of freedom are increased. The spectrum is normalized to the same variance as the red noise hypothesis (backwards) and the 99% significance level is plotted, too. After the first time through you can change any of the input parameters to see how things change. You need two additional programs fstat.m and inputwd.m to make this work. It uses a Hamming window.
Redspec is similar, except it adds periodicities and also pre-whitens the time series before it computes the spectrum.
You need to put these files in the directory, too. They are a crude F-Statistic program (99%), and one to allow default values to be specified on keyboard input.
fstat.m . . inputwd.m
Cross-Spectral Analysis: MSPEC does cross spectral analysis of two input time series.
You need to put these files in the directory, too. They are a crude F-Statistic program (99%), a crude Coherency program (99%)and one to allow default values to be specified on keyboard input.
fstat.m . . cohstat.m . . inputwd.m
Filtering with symmetric non-recursive weights: FILTD.m does some examples of 1-2-1 and running mean-5 filters, then also provides the more general Lanczos smoothed filter weights, using both Matlab and analytic functions to show that they are pretty much identical.
Filtering with symmetric non-recursive weights: LANCZ.m focuses solely on the Lanczos symmetric non-recursive weights part of filtd.m, jettisoning the 1-2-1 and block-5 filter stuff. Use this to explore how you can use the two parameters of the number of coefficients and the cutting fraction alpha to design successful filters.
You need to put inputwd.m in the directory, too.
Wavelet structures and transforms: WAVSTRT.m Does a discrete wavelet transform of a synthetic input field, inverts the transform, and also shows you what some wavelets look like after pyramid algorithm is employed.
Discrete Wavelet Transform and plotting of details analysis as stacked plots.: WAVLT.m
You need to put inputwd.m in the directory, too.