Introduction Paul J. Hurtado Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)
Workshop Overview Why do we do statistics? Estimation vs Uncertainty Quantification ODEs vs “Classical” Models Other useful topics… I.Fundamental Concepts: Review/Overview Linear models and e x Parameter Space & Bifurcations Probability & Statistics Optimization Visualization II.Computer Lab Resources: (URL) Scripts vs. console (R vs Matlab) Simulating ODE Solutions Graphics/Plotting Random numbers Manipulating Objects … III.Summary
Why do statistics? Scientific vs. Mathematical Inference Estimation & Uncertainty Quantification Statistics with dynamic models? Challenges of statistics with ODEs?
Additional Topics? Markov Chain Monte Carlo (MCMC) Bayesian Methods Filtering (Kalman, Particle, etc) Functional Data Analysis SDEs, PDEs, SPDEs… Decision Trees, Neural Networks, etc. etc!
Quick Review Linear Models Probability Parameter Space Bifurcations Visualization
Linear Equations
X Y
X Y
X Y Y = m X + b
X Y
X Y
X Y Y = m X + b + ε
X Y Y = m X + b
Why linear algebra? Curves: intuition based on lines. Models are rarely 1-dimensional! y 1 = ax 1 – bx 3 y = m x vs y 2 = – cx 1 – dx 2 + bx 3 y 3 = – bx 3 + ax 1 X Y
Matrices & Vectors… … useful notation. For example, y = Ax vs … essential tools for math/computing. or
Computers :: Matrix
Matrix Applications Two common ways matrices are used: 1.Storage variables: data, etc. * Easier, faster computations! 2. Maps/Transformations
Matrix transformations Pick a random* matrix A. It can be written: A = QDQ -1 where D=diag( λ 1, …, λ n ) are eigenvalues, & the columns of Q are their eigenvectors. y = A x Q: How does A convert x to y?
Matrix transformations Example: y 1 ’ = A 11 y1+A 12 y 2 +…+A 1n y n y 2 ’ = A 21 y1+A 22 y 2 +…+A 2n y n... y n ’ = A n1 y1+A n2 y 2 +…+A nn y n
Matrix transformations Example: y 1 ’ A 11 A 12 … A 1n y n y 2 ’ A 21 A 22 … A 2n y n... y n ’ A n1 A n2 … A nn y n = A
Matrix transformations Example: y 1 ’ λ 1 0 … 0 y n y 2 ’ 0 λ 2 … 0 y n... y n ’ 0 0 … λ n y n = QQ -1 A = Q D Q -1
Matrix transformations Example: y 1 ’ λ 1 0 … 0 y n y 2 ’ 0 λ 2 … 0 y n... y n ’ 0 0 … λ n y n = Q -1 QQ -1
Matrix transformations Example: Y 1 ’ λ 1 0 … 0 Y 1 Y 2 ’ 0 λ 2 … 0 Y 2... Y n ’ 0 0 … λ n Y n =
Matrix transformations Example: Y 1 ’ = λ 1 Y 1 Y 2 ’ = λ 2 Y 2... Y n ’ = λ n Y n
Matrix transformations Example: Y 1 (t) = Y 1 (0)exp(λ 1 t) Y 2 (t) = Y 2 (0)exp(λ 2 t)... Y n (t) = Y n (0)exp(λ n t)
Matrix transformations Example: Y 1 (t) Y 1 (0)exp(λ 1 t) Y 2 (t) Y 2 (0)exp(λ 2 t)... Y n (t) Y n (0)exp(λ n t) =
Matrix transformations Example: y 1 (t) Y 1 (0)exp(λ 1 t) y 2 (t) Y 2 (0)exp(λ 2 t)... y n (t) Y n (0)exp(λ n t) = Q
Matrix transformations Example: y 1 (t) Y 1 (0)exp(λ 1 t) y 2 (t) Y 2 (0)exp(λ 2 t)... y n (t) Y n (0)exp(λ n t) = q 1 … q n
Matrix transformations Example: y 1 (t) y 2 (t) … y n (t) = Y 1 (0)exp(λ 1 t) q 1 + … + Y n (0)exp(λ n t) q n
Matrix transformations Summary #1: Eigenpairs tells us about the geometry of matrix transformations
Matrices & Models Linear Model in matrix form: Y i = β 0 + β 1 X i + ε i where ε i ~ N(0,σ 2 )
Matrices & Models Linear Model in matrix form: Y 1 = β 0 + β 1 X 1 + ε 1 Y 2 = β 0 + β 1 X 2 + ε 2 … Y n = β 0 + β 1 X n + ε n
Matrices & Models Linear Model in matrix form: Y 1 β 0 + β 1 X 1 ε 1 Y 2 β 0 + β 1 X 2 ε 2 … Y n β 0 + β 1 X n ε n = +
Matrices & Models Linear Model in matrix form: Y 1 1 X 1 ε 1 Y 2 1 X 2 ε 2 … Y n 1 X n ε n = + β0β0 β1β1 Unknown!
Matrices & Models Linear Model in matrix form: Goal: Minimize ε’ε = (Y-Xβ)’(Y-Xβ). This is the same as solving (X’Y) = (X’X)β. Y = X β + ε Unknown!
Summary Matrices are pervasive in scientific computing, statistics. - Computing with vectors/matrices is faster, simpler than iteration/loops. - Intuition improves use, interpretation. Linear algebra is a cornerstone of stats!
X Y Y = m X + b + ε
Probability Basics
Distributions Density CDF Continuous Random Variables: Ex: Normal, Gamma, etc.
Distributions Mass CDF Discrete Random Variables: Ex: Poisson, Binomial, etc.
Distributions Mass+Density CDF 20% 80% 20% Mixed Distributions: Zero-inflated Normal, etc.
Sampling CDFs Let r~Unif(0,1), CDF F(x) with inverse F -1. Then F -1 (r) ~ F(x). Ex:.67 5.9
Distributions in R R has many built-in densities and CDFs! Density CDF Quantile Sample dnorm pnorm qnorm rnorm dpois ppois qpois rpois … beta, binomial, Cauchy, χ 2, exponential, F, gamma, geometric, hypergeometric, log- normal, multinomial, negative binomial, Student's t, uniform distribution, Weibull, etc.
Multivariate If Yi all independent, identically distributed Y i ~ f(y|θ) then their joint distribution is the product Y = (Y 1, …,Y n ) ~ f(y i |θ).
Liklihood The likelihood of data X=(X 1,…,X n ) under parameter θ is given by Lik(θ|X) = f(X i |θ). The log-likelihood of data X=(X 1,…,X n ) under parameter θ is given by LL(θ|X) = log(f(X i |θ)).
Parameter Space Bifurcations
Consumption Rate (a) Saturation Parameter (k)
Optimization
Visualization
GDP R 2 = … p = …
Questions?