Intro to Mx HGEN619 class 2005.

Slides:



Advertisements
Similar presentations
4.1 Introduction to Matrices
Advertisements

Applied Informatics Štefan BEREŽNÝ
A. The Basic Principle We consider the multivariate extension of multiple linear regression – modeling the relationship between m responses Y 1,…,Y m and.
What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS-
Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
3_3 An Useful Overview of Matrix Algebra
(Re)introduction to Mx Sarah Medland. KiwiChinese Gooseberry.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 12 System of Linear Equations.
Summarizing Data Nick Martin, Hermine Maes TC21 March 2008.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
(Re)introduction to Mx. Starting at the beginning Data preparation Mx expects 1 line per case/family Almost limitless number of families and variables.
Review of Matrix Algebra
Univariate Analysis in Mx Boulder, Group Structure Title Type: Data/ Calculation/ Constraint Reading Data Matrices Declaration Assigning Specifications/
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Univariate Analysis Hermine Maes TC19 March 2006.
Concatenation MATLAB lets you construct a new vector by concatenating other vectors: – A = [B C D... X Y Z] where the individual items in the brackets.
Matrix Algebra International Workshop on Methodology for Genetic Studies Boulder Colorado March 2006.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Special Topic: Matrix Algebra and the ANOVA Matrix properties Types of matrices Matrix operations Matrix algebra in Excel Regression using matrices ANOVA.
Matrix Approach to Simple Linear Regression KNNL – Chapter 5.
Lecture 7: Matrix-Vector Product; Matrix of a Linear Transformation; Matrix-Matrix Product Sections 2.1, 2.2.1,
Intro to Matrices Don’t be scared….
MATRICES MATRIX OPERATIONS. About Matrices  A matrix is a rectangular arrangement of numbers in rows and columns. Rows run horizontally and columns run.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Today Wrap up of probability Vectors, Matrices. Calculus
Chapter 10 Review: Matrix Algebra
BIOL 582 Lecture Set 19 Matrices, Matrix calculations, Linear models using linear algebra.
Presentation on Matrices and some special matrices In partial fulfillment of the subject Vector calculus and linear algebra ( ) Submitted by: Agarwal.
Summarizing Variation Matrix Algebra Benjamin Neale Analytic and Translational Genetics Unit, Massachusetts General Hospital Program in Medical and Population.
Matlab Chapter 2: Array and Matrix Operations. What is a vector? In Matlab, it is a single row (horizontal) or column (vertical) of numbers or characters.
Statistics and Linear Algebra (the real thing). Vector A vector is a rectangular arrangement of number in several rows and one column. A vector is denoted.
Multivariate Statistics Matrix Algebra I W. M. van der Veld University of Amsterdam.
2009/9 1 Matrices(§3.8)  A matrix is a rectangular array of objects (usually numbers).  An m  n (“m by n”) matrix has exactly m horizontal rows, and.
Introduction to Matrices and Matrix Approach to Simple Linear Regression.
Module #9: Matrices Rosen 5 th ed., §2.7 Now we are moving on to matrices, section 7.
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
Univariate Analysis Hermine Maes TC21 March 2008.
Special Topic: Matrix Algebra and the ANOVA Matrix properties Types of matrices Matrix operations Matrix algebra in Excel Regression using matrices ANOVA.
MATRICES Operations with Matrices Properties of Matrix Operations
Mx Practical TC20, 2007 Hermine H. Maes Nick Martin, Dorret Boomsma.
Welcome  Log on using the username and password you received at registration  Copy the folder: F:/sarah/mon-morning To your H drive.
A ij i = row j = column A [ A ] Definition of a Matrix.
Matrices. Matrix - a rectangular array of variables or constants in horizontal rows and vertical columns enclosed in brackets. Element - each value in.
QTL Mapping Using Mx Michael C Neale Virginia Institute for Psychiatric and Behavioral Genetics Virginia Commonwealth University.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
MATRICES A rectangular arrangement of elements is called matrix. Types of matrices: Null matrix: A matrix whose all elements are zero is called a null.
LAB 2 Vectors and Matrices Dr.Abdel Fattah FARES.
MTH108 Business Math I Lecture 20.
Categorical Data HGEN
Matrices and Vector Concepts
Linear Algebraic Equations and Matrices
1.5 Matricies.
Linear Algebraic Equations and Matrices
Statistical Computing in MATLAB
Univariate Analysis HGEN619 class 2006.
MATLAB DENC 2533 ECADD LAB 9.
Warm-up a. Solve for k: 13 −5
MATRICES MATRIX OPERATIONS.
Matrices Definition: A matrix is a rectangular array of numbers or symbolic elements In many applications, the rows of a matrix will represent individuals.
MATRICES MATRIX OPERATIONS.
(Re)introduction to Mx Sarah Medland
Matrices Introduction.
Matrices.
Announcements P3 due today
BOULDER WORKSHOP STATISTICS REVIEWED: LIKELIHOOD MODELS
MATRICES MATRIX OPERATIONS.
MATRICES MATRIX OPERATIONS.
Multivariate Genetic Analysis: Introduction
Matrices and Determinants
Presentation transcript:

Intro to Mx HGEN619 class 2005

General Comments case insensitive, except for filenames under Unix comments: anything following a ! blank lines commands: identified by first 2 letters, BUT recommended to use full words

Job Structure three types of groups: number of groups indicated by Data, Calculation, Constraint number of groups indicated by #NGroups 3 at the beginning of job jobs can be stacked in one run

Group Structure Title Group type: data, calculation, constraint [Read observed data, Select, Labels] Matrices declaration [Specify numbers, parameters, etc.] Algebra section and/or Model statement [Options] End

Read Observed Data Data NInputvars=2 [NObservations=123] CMatrix/ Means/ CTable/ summary statistics read from script / file (File=filename) Rectangular/ Ordinal / VLength raw data Select variables ; [by number/label] Labels variables

Matrix Declaration Group 1 Begin Matrices; End Matrices; Group 2 C Full 2 3 Free ! [name type rows columns free] ! more matrices ! default element is fixed at 0 End Matrices; Group 2 Begin Matrices = Group 1; ! copies all matrices from group 1 D Full 2 3 = C1 ! equates D to C of group 1

Matrix Types (Mx manual p.56) Structure Shape Free Zero Null (zeros) Any Unit Unit (ones) Iden Identity Square Diag Diagonal r SDiag Subdiagonal r(r-1)/2 Stand Standardized Symm Symmetric r(r+1)/2 Lower Lower triangular Full r x c Computed Equated to

Matrices Example Command Specification Matrix Values A Zero 2 3 Free 0 0 0 B Unit 2 3 Free 1 1 1 C Iden 3 3 Free 1 0 0 0 1 0 0 0 1 D Izero 2 5 Free 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 E Ziden 2 5 Free 0 0 0 1 0 0 0 0 0 1

Matrices II Example Command Specification Matrix Values F Diag 3 3 Free 1 0 0 0 2 0 0 0 3 ? 0 0 0 ? 0 0 0 ? G SDiag 3 3 Free 0 0 0 2 3 0 ? ? 0 H Stand 3 3 Free 0 1 2 1 0 3 1 ? ? ? 1 ? ? ? 1

Matrices III Example Command Specification Matrix Values I Symm 3 3 Free 1 2 4 2 3 5 4 5 6 ? ? ? J Lower 3 3 Free 1 0 0 2 3 0 ? 0 0 ? ? 0 K Full 2 4 Free 1 2 3 4 5 6 7 8 ? ? ? ?

Constrained Matrices * Syntax Matrix Quantity Dimensions %On Observed covariance matrix NI x NI %En Expected covariance matrix %Mn Expected mean vector 1 x NI %Pn Expected proportions NR x NC %Fn Function value 1 x 1 * to special quantities in previous groups

Matrix Algebra / Model Begin Algebra; End Algebra; B = A*A'; C = B+B; ... End Algebra; Means [continuous] / Thresholds [categorical] X; Covariances X; Weight / Frequency X; X: matrix or matrix formula

Unary Matrix Operations Symbol Name Function Example Priority ~ Inverse Inversion A~ 1 ` Transpose Transposition A`

Binary Matrix Operations Symbol Name Function Example Priority ^ Power Element powering A^B 2 * Star Multiplication A*B 3 . Dot Dot multiplication A.B @ Kronecker Kronecker product A@B & Quadratic Quadratic product A&B % Eldiv Element division A%B + Plus Addition A+B 4 - Minus Subtraction A-B | Bar Horizontal adhesion A|B _ Underscore Vertical adhesion A_B

Matrix Operations (Mx p.59) Symbol Name Function Example Priority ~ Inverse Inversion A~ 1 ` Transpose Transposition A` ^ Power Element powering A^B 2 * Star Multiplication A*B 3 . Dot Dot multiplication A.B @ Kronecker Kronecker product A@B & Quadratic Quadratic product A&B % Eldiv Element division A%B + Plus Addition A+B 4 - Minus Subtraction A-B | Bar Horizontal adhesion A|B _ Underscore Vertical adhesion A_B

Matrix Functions (Mx p. 64) Keyword Function Restrictions Dimensions \tr() Trace r=c 1 x 1 \det() Determinant \sum() Sum None \prod() Product \max() Maximum \min() Minimum \abs() Absolute value r x c \exp() Exponent \ln() Natural logaritm \sqrt() Square root

Matrix Functions II Keyword Function Restrictions Dimensions \stand() Standardize r=c r x c \mean() Mean of columns None 1 x c \cov() Covariance of cols c x c \pdfnor() Mv normal density r=c+2 1 x 1 \mnor() Mv normal integral r=c+3 \pchi() Probability of Chi^2 r=1 c=2 1 x 2 \d2v() Diagonal to vector Min(r,c) x 1 \m2v() Matrix to vector rc x 1 \part() Extract part of vector variable

Specify Numbers/ Parameters Matrix <name> <number list> Start/Value <name> <value> <element list> Parameters Fix/Free <value> <element list> Equate <name GRC> <name GRC> Specify <name> <integer list> Bound low high <parameter list/element list> Label Matrices Label Row/Column <name> <label list>

Options Statistical Output Power Calculations Confidence Intervals Suppressing output: No_Output Appearance: NDecimals=n Residuals: RSiduals Adjusting Degrees of Freedom: DFreedom=n Power Calculations Power = alpha,df Confidence Intervals Interval {@value} <matrix element list>

Options Optimization options Bootstrap Estimates Randomizing Starting Values: THard=n Automatic Cold Restart: THard=-n Jiggling Parameter Starting Values: Jiggle Confidence Intervals on Fit Statistics Comparative Fit Indices: Null Likelihood-Ratio Statistics of Submodels: Issat/ Sat Check Identification of Model: Check

Fitting Submodels Multiple Fit Option Multiple: Matrix/ Value/ Start/ Equate/ Fix/ Free/ Options Drop {@value} <parlist> <element list> Binary Save/Get <filename> Writing Matrices to Files MXn = <filename> Writing Individual Likelihood Stats to Files: MX%P = <filename>

Mx Graphical Interface Language www.vcu.edu/mx