ASTR/PHYS 7730
Lab Exercise 04 (lab04)


Exercise 1.

In python, create N=1000 samples of a normal bivariate distribution (mu=0, sigma=1), (p(x,y)~exp(-(x*x+y*y)/2). Make a scatter plot of the random points in the x-y plane. Confirm that the covariance matrix is the unit matrix, or at least converges to it in the limit of large N. [This code could help, but spoiler alert, it is also a solution.]

Exercise 2.

Using the code in Exercise 1, create N=1000 samples of a Gaussian bivariate distribution in variates x and y with zero mean and sigma_x=1.0, sigma_y=0.5 and correlation coefficient rho=0.7. Confirm that you can estimate the expected covariance matrix. Make a scatter plot of your (x,y) samples.

Exercise 3.

With your code in Exercise 2, calcuate the Pearson, Spearman, and Kendall correlation coefficients. Vary N and rho (from -1..1) to see how these measures depend on sample size and the underying correlation between x and y.

Exercise 4.

Generate a time series of uncorrelate N=1024 points y(t) sampled over an interval of 32 seconds sample at a rate of 32 Hz. Estimate the autocorrelation function and the power spectral density. [Note scipy.signal has convenient algorithms. Also see this code]

Exercise 5.

Repeat Exercise 4 but using a time series that is smoothed with a boxcar function that is 2 seconds in width.