Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Midterm 2

Answer key for MT2: here

Exam logistics

Study guide

This page provides a list of the key concepts that you should focus your studying on for this exam.

Unit 05: Linear regression

Background

How a linear regression model enables us to make predictions, including out of sample

Out-of-sample predictions: assuming the relationship stays the same as it is in-sample

Covariance

Correlation

Linear regression

Unit 06: Hypothesis tests

Goal: determine statistical significance of signals observed in your datasets. In other words: quantitatively estimate the contributions from randomess vs. actual meaningful difference between two samples.

Of our particular concern: the significance of the difference in means between two datasets: μ^Xμ^Y\hat\mu_X-\hat\mu_Y

What statistically significant means: conceptually, that the signal (the difference in the two sample means) is sufficiently large relative to the noise (the variance within the individual samples).

What does sufficiently mean? It depends on the context...some applications you want to be extremely sure that the signal was “real”, i.e. not just accidentally caused by randomness (i.e. a false positive), whereas you can live with more false negatives. In other cases, you’re OK with more false positives and would prefer less false negatives.

True/false positives and true/false negatives

null hypothesis (both samples are drawn from the same population) and alternative hypothesis (the two samples are drawn from different populations with different means)

t test for difference in means, which relies on Student’s tt dstribution

t distribution: shape depends on the number of degrees of freedom, ν\nu. As ν\nu gets larger, the t approaches the Gaussian.

t statistic: think of it as a signal-to-noise ratio. Numerator is the difference in the sample means (“the signal”); denominator is a (weighted) average of the two standard deviations

decision rule: if t smaller in magnitude than the threshold we pre-selected, do NOT reject the null hypothesis. Otherwise, reject the null hypothesis. “Statistically significant” = the null was rejected

p value: not just “reject/not reject”: more quantitative information. Specifically, the chance that you would obtained the given tt statistic value or an even larger one, if it was the case that the null hypothesis was true.

Lower p = more significant. Most common threshold used: p=0.05. p=0.01 or 0.10 also common.

t test assumptions:

  1. independence of observations.

  2. both samples drawn from normal distributions

  3. both samples have equal variance

  4. samples are randomly sampling the population(s) you’re claiming that they’re sampling

Unit 07: Timeseries analysis

Timeseries basics

decomposition into deterministic and random parts.

When applied to real samples, we call the random part the anomaly: full minus deterministic

serial correlation

autocovariance: covariance between a timeseries and itself, shifted in time by a specified lag τ\tau

autocorrelation

sample autocovariance function and sample autocorrelation function: autocovariance and autocorrelation as a function of all possible lags

stationarity, stationary timeseries and non-stationary timeseries

stochastic process, ensemble, ensemble average

autoregressive models: value at a given timestep is determined by some linear combination of one or more previous timesteps, plus white noise.

1st order AR model (AR1): I’ll give you the formula but you need to understand what each term means. It is: Xt=ϕXt1+Wt+kX_t=\phi X_{t-1}+W_t+k, where ϕ\phi is a constant 1<ϕ<1-1<\phi<1, WtW_t is a white noise process, and kk is a constant.

ACF of an AR1 process: ρτ=ϕτ\rho_\tau=\phi^{|\tau|}. Since 1<ϕ<1-1<\phi<1, this decreases monotonically in magnitude going to larger lags.

white noise process: distribution at each timestep is independent of the distributions at all other timesteps.

Gaussian white noise: white noise process in which the distribution being drawn from is Gaussian

Unit 08: Spectral analysis

Overall approach: switch from looking at the time evolution of timeseries to looking at the amplitude, a.k.a. power, of the timeseries at different frequencies

frequency: cycles per unit time. period: time per cycle. So frequency and period are inverses of each other.

Fourier analysis: technique for decomposing timeseries into sum of sines and cosines at different frequencies

Discrete Fourier transform(DFT): applying Fourier decomposition to discrete (rather than continuous) timeseries

Formally: Xt=j=0N/2(Ajcos(ωjt)+Bjsin(ωjt)),X_t=\sum_{j=0}^{N/2}\left(A_j\cos(\omega_j t)+B_j\sin(\omega_j t)\right), where XtX_t is the timeseries, NN is the number of timesteps, and ωj\omega_j is the Fourier frequencies: ωj=2πj/N\omega_j=2\pi j/N

The amplitudes AjA_j and BjB_j can be solved for (formulas will be given if they are needed).

Method computers use to perform DFT: fast fourier transform (FFT)

Fourier transform inversion: from the computed Fourier coefficients, can invert to get back the original timeseries

Parseval’s identity: the sample variance equals the (slightly weighted) sum of the squared amplitudes of all of the Fourier coefficients

periodogram and power spectrum: like Discrete Fourier transform, but frequency not restricted to the Fourier frequencies.

Nyquist frequency: 1 cycle per two timesteps is the highest frequency oscillation that any timeseries can resolve. It corresponds to values going up one timestep, down the next, up the next, down the next, etc.

aliasing: if your sampling rate is insufficiently rapid---such as for frequencies higher than the Nyquist frequency---it’s impossible to discern between (particular) different frequencies: a rapid oscillation sampled at particular, low frequencies will spuriously appear to be a slower oscillation.