1 Matrix Algebra Variation and Likelihood Michael C Neale Virginia Institute for Psychiatric and Behavioral Genetics VCU International Workshop on Methodology.

Slides:



Advertisements
Similar presentations
I OWA S TATE U NIVERSITY Department of Animal Science Using Basic Graphical and Statistical Procedures (Chapter in the 8 Little SAS Book) Animal Science.
Advertisements

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
STUDENTS WILL DEMONSTRATE UNDERSTANDING OF THE CALCULATION OF STANDARD DEVIATION AND CONSTRUCTION OF A BELL CURVE Standard Deviation & The Bell Curve.
Probability Distributions CSLU 2850.Lo1 Spring 2008 Cameron McInally Fordham University May contain work from the Creative Commons.
Bivariate and Partial Correlations. X (HT) Y (WT) The Graphical View– A Scatter Diagram X’ Y’
Summarizing Variation Matrix Algebra & Mx Michael C Neale PhD Virginia Institute for Psychiatric and Behavioral Genetics Virginia Commonwealth University.
1 MF-852 Financial Econometrics Lecture 3 Review of Probability Roy J. Epstein Fall 2003.
The General Linear Model. The Simple Linear Model Linear Regression.
A Short Introduction to Curve Fitting and Regression by Brad Morantz
Chapter 2: Probability Random Variable (r.v.) is a variable whose value is unknown until it is observed. The value of a random variable results from an.
1 Def: Let and be random variables of the discrete type with the joint p.m.f. on the space S. (1) is called the mean of (2) is called the variance of (3)
Summarizing Variation Michael C Neale PhD Virginia Institute for Psychiatric and Behavioral Genetics Virginia Commonwealth University.
Chapter Topics Types of Regression Models
Edpsy 511 Homework 1: Due 2/6.
Visual Recognition Tutorial1 Random variables, distributions, and probability density functions Discrete Random Variables Continuous Random Variables.
1A.1 Copyright© 1977 John Wiley & Son, Inc. All rights reserved Review Some Basic Statistical Concepts Appendix 1A.
Conditional Distributions and the Bivariate Normal Distribution James H. Steiger.
1 Multivariate Normal Distribution Shyh-Kang Jeng Department of Electrical Engineering/ Graduate Institute of Communication/ Graduate Institute of Networking.
Separate multivariate observations
Measures of Central Tendency
Lecture 3-2 Summarizing Relationships among variables ©
LIS 570 Summarising and presenting data - Univariate analysis continued Bivariate analysis.
Fundamentals of Statistical Analysis DR. SUREJ P JOHN.
4. Random Variables A random variable is a way of recording a quantitative variable of a random experiment.
Summarizing Variation Matrix Algebra Benjamin Neale Analytic and Translational Genetics Unit, Massachusetts General Hospital Program in Medical and Population.
Covariance and correlation
Correlation and Regression
Permutations & Combinations and Distributions
Ch2: Probability Theory Some basics Definition of Probability Characteristics of Probability Distributions Descriptive statistics.
Lecture 3 A Brief Review of Some Important Statistical Concepts.
QBM117 Business Statistics Probability and Probability Distributions Continuous Probability Distributions 1.
Why statisticians were created Measure of dispersion FETP India.
Measures of Variability Objective: Students should know what a variance and standard deviation are and for what type of data they typically used.
Introduction to Linear Regression
Chap 12-1 A Course In Business Statistics, 4th © 2006 Prentice-Hall, Inc. A Course In Business Statistics 4 th Edition Chapter 12 Introduction to Linear.
1 G Lect 8b G Lecture 8b Correlation: quantifying linear association between random variables Example: Okazaki’s inferences from a survey.
Basic Statistics Correlation Var Relationships Associations.
Production Planning and Control. A correlation is a relationship between two variables. The data can be represented by the ordered pairs (x, y) where.
Measures of central tendency are statistics that express the most typical or average scores in a distribution These measures are: The Mode The Median.
STA347 - week 51 More on Distribution Function The distribution of a random variable X can be determined directly from its cumulative distribution function.
Probability and Statistics
INVESTIGATION Data Colllection Data Presentation Tabulation Diagrams Graphs Descriptive Statistics Measures of Location Measures of Dispersion Measures.
The two way frequency table The  2 statistic Techniques for examining dependence amongst two categorical variables.
Two Main Uses of Statistics: 1)Descriptive : To describe or summarize a collection of data points The data set in hand = the population of interest 2)Inferential.
PATTERN RECOGNITION LAB 3 TA : Nouf Al-Harbi::
The Pearson Product-Moment Correlation Coefficient.
Edpsy 511 Exploratory Data Analysis Homework 1: Due 9/19.
Session 1 Probability to confidence intervals By : Allan Chang.
Probability Theory Modelling random phenomena. Permutations the number of ways that you can order n objects is: n! = n(n-1)(n-2)(n-3)…(3)(2)(1) Definition:
Pattern Recognition Mathematic Review Hamid R. Rabiee Jafar Muhammadi Ali Jalali.
QTL Mapping Using Mx Michael C Neale Virginia Institute for Psychiatric and Behavioral Genetics Virginia Commonwealth University.
Correlation and regression by M.Shayan Asad
Biostatistics Class 3 Probability Distributions 2/15/2000.
Cell Diameters and Normal Distribution. Frequency Distributions a frequency distribution is an arrangement of the values that one or more variables take.
Correlation and Covariance
Boulder Colorado Workshop March
Virtual University of Pakistan
Description of Data (Summary and Variability measures)
Introduction to Linkage and Association for Quantitative Traits
Linkage in Selected Samples
The normal distribution
Lecture Slides Elementary Statistics Twelfth Edition
Correlation and Covariance
Lecture Slides Elementary Statistics Twelfth Edition
Ch11 Curve Fitting II.
Lecture Slides Essentials of Statistics 5th Edition
Multivariate Genetic Analysis: Introduction
Lecture Slides Essentials of Statistics 5th Edition
Presentation transcript:

1 Matrix Algebra Variation and Likelihood Michael C Neale Virginia Institute for Psychiatric and Behavioral Genetics VCU International Workshop on Methodology for Genetic Studies Boulder Colorado 2 nd March

2 Overview Matrix multiplication review Variation & covariation Likelihood Theory Practical

3 Three Kinds of Matrix Multiplication Dot/Hadamard: element by element  In R use *  ncol(A) = ncol(B) AND nrow(A) = nrow(B) Ordinary matrix multiplication  In R use %*%  # of columns in A = # of rows in B Kronecker multiplication  In R use %x%  No conformability conditions

4 Dot or Hadamard Multiplication 6 x 2 7 x 38 x 4 5 x 1 i,j

5 Ordinary Multiplication Multiply: A (m x n) by B (n by p)

6 Ordinary Multiplication I

7 Ordinary Multiplication II

8 Ordinary Multiplication III

9 Ordinary Multiplication IV

10 Ordinary Multiplication V

11 Ordinary Multiplication VI

12 Ordinary Multiplication VII

13 Kronecker or Direct Product

14 Kronecker or Direct Product

15 Summarizing Variation and Likelihood 15

16 Computing Mean Formula  (x i )/N Can compute with  Pencil  Calculator  SAS  SPSS  R mean(dataframe)  OpenMx 16

17 Variance: elementary probability theory 2 outcomes HeadsTails Outcome Probability

18 Two Coin toss 3 outcomes HHHT/THTT Outcome Probability

19 Four Coin toss 5 outcomes HHHHHHHTHHTTHTTTTTTT Outcome Probability

20 Ten Coin toss 9 outcomes Outcome Probability

21 Fort Knox Toss Heads-Tails De Moivre 1733 Gauss 1827 Infinite outcomes

22 Dinosaur (of a) Joke § Elk: The Theory by A. Elk brackets Miss brackets. My theory is along the following lines. § Host: Oh God. § Elk: All brontosauruses are thin at one end, much MUCH thicker in the middle, and then thin again at the far end. tch?v=cAYDiPizDIs tch?v=cAYDiPizDIs 22

23 Pascal's Triangle Pascal's friend Chevalier de Mere 1654; Huygens 1657; Cardan /1 1/2 1/4 1/8 1/16 1/32 1/64 1/128 Frequency Probability

24 Variance § Measure of Spread § Easily calculated § Individual differences

25 Average squared deviation Normal distribution  xixi didi Variance =    d i 2 /N

26 Measuring Variation Absolute differences? Squared differences? Absolute cubed? Squared squared? Weighs & Means ?

27 Squared differences Fisher (1922) On the mathematical foundations of theoretical statistics. Phil Trans Roy Soc London A 222: Squared has minimum variance under normal distribution Measuring Variation Weighs & Means

28 Covariance Measure of association between two variables Closely related to variance Useful to partition variance 28

29 Deviations in two dimensions xx yy                                 

30 Deviations in two dimensions xx yy  dx dy

31 Measuring Covariation A square, perimeter 4 Area 1 Concept: Area of a rectangle 1 1

32 Measuring Covariation A skinny rectangle, perimeter 4 Area.25*1.75 =.4385 Concept: Area of a rectangle

33 Measuring Covariation Points can contribute negatively Area -.25*1.75 = Concept: Area of a rectangle

34 Measuring Covariation Covariance Formula: Average cross-product of deviations from mean  =  (x i -  x )(y i -  y ) xy N

35 Correlation Standardized covariance Lies between -1 and 1 r =  xy 2 2 y x  * 

36 Summary Formulae for sample statistics; i=1…N observations  = (  x i )/N  x  =  (x i -  x ) / (N) 2 2 r =  xy 2 2 x x   xy  =  (x i -  x )(y i -  y ) / (N)

37 Variance covariance matrix Several variables Var(X) Cov(X,Y) Cov(X,Z) Cov(X,Y) Var(Y) Cov(Y,Z) Cov(X,Z) Cov(Y,Z) Var(Z)

38 Variance covariance matrix Univariate Twin Data Var(Twin1) Cov(Twin1,Twin2) Cov(Twin2,Twin1) Var(Twin2) Only suitable for complete data Good conceptual perspective

39 Conclusion Means and covariances Basic input statistics for “Traditional SEM” Easy to compute Can use raw data instead 39

40 Likelihood: Normal Theory Calculate height of curve 40

41 Height of normal curve Probability density function xx xixi  (x i )  (x i ) is the likelihood of data point x i for particular mean & variance estimates

42

43 xixi

44 Height of bivariate normal curve An unlikely pair of (x,y) values xx xixi yiyi yy

45 R graphics: ues/ ues/ 45

mu1<-0 # set the expected value of x1 mu2<-0 # set the expected value of x2 s11<-10 # set the variance of x1 s22<-10 # set the variance of x2 rho<-0.0 # set the correlation coefficient between x1 and x2 x1<-seq(-10,10,length=41) # generate series for values of x1 & x2 x2<-x1 # copy x1 to x2 # set up the bivariate normal density function - could use f<-function(x1,x2){ term1 <- 1/(2*pi*sqrt(s11*s22*(1-rho^2))) term2 <- -1/(2*(1-rho^2)) term3 <- (x1-mu1)^2/s11 term4 <- (x2-mu2)^2/s22 term5 <- -2*rho*((x1-mu1)*(x2-mu2))/(sqrt(s11)*sqrt(s22)) term1*exp(term2*(term3+term4-term5)) } # calculate the density values z<-outer(x1,x2,f) # generate the 3-D plot persp(x1, x2, z, main="Two dimensional Normal Distribution", sub=expression(italic(f)~(bold(x))==frac(1,2~pi~sqrt(sigma[11]~ sigma[22]~(1-rho^2)))~phantom(0)~exp~bgroup("{", list(-frac(1,2(1-rho^2)), bgroup("[", frac((x[1]~-~mu[1])^2, sigma[11])~-~2~rho~frac(x[1]~-~mu[1], sqrt(sigma[11]))~ frac(x[2]~-~mu[2],sqrt(sigma[22]))~+~ frac((x[2]~-~mu[2])^2, sigma[22]),"]")),"}")), col="lightblue", theta=30, phi=20, r=50, d=0.1, expand=0.5, ltheta=90, lphi=180, shade=0.75, ticktype="detailed", nticks=5) # adding a text line to the graph mtext(expression(list(mu[1]==0,mu[2]==0,sigma[11]==10,sigma[22]==10,sigma[12]==15,rho==0.0)), side=3) 46

47 Text

48 Exercises: Compute Normal PDF Get used to OpenMx script language Use matrix algebra Taste of likelihood theory 48