introduction paul j. hurtado mathematical biosciences institute (mbi), the ohio state university 19...

54
Introduction Paul J. Hurtado http://www.pauljhurtado.com/ Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Upload: anne-gray

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

Why do statistics? Scientific vs. Mathematical Inference Estimation & Uncertainty Quantification Statistics with dynamic models? Challenges of statistics with ODEs?

TRANSCRIPT

Page 1: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

IntroductionPaul J. Hurtado

http://www.pauljhurtado.com/Mathematical Biosciences Institute

(MBI),The Ohio State University

19 May 2014 (Monday a.m.)

Page 2: 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 ex

• 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

Page 3: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Why do statistics?•Scientific vs. Mathematical

Inference•Estimation & Uncertainty

Quantification

Statistics with dynamic models?•Challenges of statistics with ODEs?

Page 4: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

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!

Page 5: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Quick Review

•Linear Models•Probability•Parameter Space Bifurcations•Visualization

Page 6: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Linear Equations

Page 7: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)
Page 8: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Page 9: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)
Page 10: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Y = m X + b

Page 11: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Y = m X + b

Page 12: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Y = m X + b

Page 13: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Y = m X + b + ε

Page 14: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Y = m X + b

Page 15: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Why linear algebra?

• Curves: intuition based on lines.

• Models are rarely 1-dimensional! y1 = ax1 – bx3

y = m x vs y2 = – cx1 – dx2 + bx3

y3 = – bx3 + ax1

X

Y

Page 16: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrices & Vectors…… useful notation. For example, y =

Ax vs

… essential tools for math/computing.

or

Page 17: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Computers :: Matrix

Page 18: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix ApplicationsTwo common ways matrices are used:

1. Storage variables: data, etc.* Easier, faster computations!

2. Maps/Transformations

Page 19: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

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 xQ: How does A convert x to y?

Page 20: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1’ = A11y1+A12y2+…+A1nyn

y2’ = A21y1+A22y2+…+A2nyn

...

yn’ = An1y1+An2y2+…+Annyn

Page 21: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1’ A11 A12 … A1n yn

y2’ A21 A22 … A2n yn

...

yn’ An1 An2 … Ann yn

=

A

Page 22: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1’ λ1 0 … 0 yn

y2’ 0 λ2 … 0 yn

...

yn’ 0 0 … λn yn

= Q Q-1

A = Q D Q-1

Page 23: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1’ λ1 0 … 0 yn

y2’ 0 λ2 … 0 yn

...

yn’ 0 0 … λn yn

= Q-1Q Q-1Q-1

Page 24: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

Y1’ λ1 0 … 0 Y1

Y2’ 0 λ2 … 0 Y2

...

Yn’ 0 0 … λn Yn

=

Page 25: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

Y1’ = λ1 Y1

Y2’ = λ2 Y2

...

Yn’ = λn Yn

Page 26: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

Y1(t) = Y1(0)exp(λ1t)

Y2(t) = Y2(0)exp(λ2t)

...

Yn(t) = Yn(0)exp(λnt)

Page 27: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

Y1(t) Y1(0)exp(λ1t)

Y2(t) Y2(0)exp(λ2t)

...

Yn(t) Yn(0)exp(λnt)

=

Page 28: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1(t) Y1(0)exp(λ1t)

y2(t) Y2(0)exp(λ2t)

...

yn(t) Yn(0)exp(λnt)

= Q

Page 29: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1(t) Y1(0)exp(λ1t)

y2(t) Y2(0)exp(λ2t)

...

yn(t) Yn(0)exp(λnt)

= q1 … qn

Page 30: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Example:

y1(t) y2(t)

yn(t)

= Y1(0)exp(λ1t) q1 + … + Yn(0)exp(λnt) qn

Page 31: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrix transformations

Summary #1: Eigenpairs tells us about the geometry of matrix transformations

Page 32: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrices & ModelsLinear Model in matrix form:

Yi = β0 + β1 Xi + εi where εi ~ N(0,σ2)

Page 33: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrices & ModelsLinear Model in matrix form:

Y1 = β0 + β1 X1 + ε1

Y2 = β0 + β1 X2 + ε2

…Yn = β0 + β1 Xn + εn

Page 34: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrices & ModelsLinear Model in matrix form:

Y1 β0 + β1 X1 ε1

Y2 β0 + β1 X2 ε2

…Yn β0 + β1 Xn εn

= +

Page 35: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrices & ModelsLinear Model in matrix form:

Y1 1 X1 ε1

Y2 1 X2 ε2

…Yn 1 Xn εn

= +β0

β1

Unknown!

Page 36: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Matrices & ModelsLinear Model in matrix form:

Goal: Minimize ε’ε = (Y-Xβ)’(Y-Xβ).

This is the same as solving (X’Y) = (X’X)β.

Y = X β + εUnknown!

Page 37: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

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!

Page 38: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

X

Y

Y = m X + b + ε

Page 39: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Probability Basics

Page 40: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Distributions Density CDF

Continuous Random Variables: Ex: Normal, Gamma, etc.

Page 41: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Distributions Mass CDF

Discrete Random Variables: Ex: Poisson, Binomial, etc.

Page 42: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Distributions Mass+Density CDF

20%

80%

20%

Mixed Distributions: Zero-inflated Normal,

etc.

Page 43: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Sampling CDFsLet r~Unif(0,1), CDF F(x) with inverse

F-1. Then F-1(r) ~ F(x). Ex: .67 5.1 .12 0.0 .85 5.9

Page 44: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Distributions in RR 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.

Page 45: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Multivariate If Yi all independent, identically

distributedYi ~ f(y|θ)

then their joint distribution is the product

Y = (Y1, …,Yn) ~ f(yi|θ).

Page 46: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

LiklihoodThe likelihood of data X=(X1,…,Xn)

under parameter θ is given byLik(θ|X) = f(Xi|θ).

The log-likelihood of data X=(X1,…,Xn) under parameter θ is given by

LL(θ|X) = log(f(Xi|θ)).

Page 47: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Parameter Space Bifurcations

Page 48: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Consumption Rate (a)

Satu

ratio

n Pa

ram

eter

(k)

Page 49: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Optimization

Page 50: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Visualization

Page 51: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

GDP

Life

Exp

ecta

ncy

R2 = … p = …

Page 52: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)
Page 53: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)
Page 54: Introduction Paul J. Hurtado  Mathematical Biosciences Institute (MBI), The Ohio State University 19 May 2014 (Monday a.m.)

Questions?