Module 28.3: nag mv rotation Rotations. Contents

Similar documents
nag mv orthomax (g03bac)

Module 25.2: nag correl Correlation Analysis. Contents

Module 19.1: nag ip Integer Programming. Contents

Module 29.1: nag tsa identify Time Series Analysis Identification. Contents

Module 5.5: nag sym bnd lin sys Symmetric Banded Systems of Linear Equations. Contents

Module 25.1: nag lin reg Regression Analysis. Contents

Module 7.2: nag sym fft Symmetric Discrete Fourier Transforms. Contents

Module 3.7: nag ell fun Elliptic Functions. Contents

Module 3.5: nag fresnel intg Fresnel Integrals. Contents

Module 6.4: nag lin lsq Linear Least-squares Problems. Contents

Review More Arrays Modules Final Review

PACKAGE SPECIFICATION HSL 2013

NAG Library Routine Document G02BXF.1

NAG Library Routine Document G02DAF.1

Allocating Storage for 1-Dimensional Arrays

NAG Library Routine Document G02BGF.1

A Brief Introduction to Fortran of 15

Clustering and Visualisation of Data

NAG Library Routine Document G02DDF.1

Chapter 6. A Brief Introduction to Fortran David A. Padua

AMath 483/583 Lecture 8

NAG Library Routine Document F08LEF (DGBBRD)

For example, the system. 22 may be represented by the augmented matrix

NAG Library Function Document nag_mv_ordinal_multidimscale (g03fcc)

NAG Library Function Document nag_mv_prin_comp (g03aac)

Lecture V: Introduction to parallel programming with Fortran coarrays

Dimension reduction : PCA and Clustering

6.1 Expression Evaluation. 1 of 21

Subroutines and Functions

Introduction to Programming with Fortran 90

NAG Library Function Document nag_mv_promax (g03bdc)

ARRAYS COMPUTER PROGRAMMING. By Zerihun Alemayehu

PACKAGE SPECIFICATION HSL 2013

NAG Library Routine Document G05PZF.1

nag mv kmeans cluster analysis (g03efc)

All use is subject to licence. See For any commercial application, a separate license must be signed.

Adaptive Estimation of Distributions using Exponential Sub-Families Alan Gous Stanford University December 1996 Abstract: An algorithm is presented wh

Review Functions Subroutines Flow Control Summary

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

7. Procedures and Structured Programming

REGULAR GRAPHS OF GIVEN GIRTH. Contents

Subroutines, Functions and Modules

Welcome. Modern Fortran (F77 to F90 and beyond) Virtual tutorial starts at BST

NAG Library Routine Document G05REF.1

NAG Library Routine Document G05RGF.1

The Use of Biplot Analysis and Euclidean Distance with Procrustes Measure for Outliers Detection

Preliminaries: Size Measures and Shape Coordinates

Parallel and perspective projections such as used in representing 3d images.

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

Algebraic Graph Theory- Adjacency Matrix and Spectrum

Chapter 4. Matrix and Vector Operations

1 2 (3 + x 3) x 2 = 1 3 (3 + x 1 2x 3 ) 1. 3 ( 1 x 2) (3 + x(0) 3 ) = 1 2 (3 + 0) = 3. 2 (3 + x(0) 1 2x (0) ( ) = 1 ( 1 x(0) 2 ) = 1 3 ) = 1 3

NAG Library Routine Document G01ABF.1

Note Set 4: Finite Mixture Models and the EM Algorithm

MODERN FACTOR ANALYSIS

NAG Toolbox for MATLAB. g02ef.1

MATH 423 Linear Algebra II Lecture 17: Reduced row echelon form (continued). Determinant of a matrix.

NAG Library Routine Document F07KDF (DPSTRF)

Applications Guide 3WayPack TUCKALS3: Analysis of Chopin Data

nag anova random (g04bbc)

NAG Library Routine Document E04UDF/E04UDA

Unsupervised Learning : Clustering

NAG Library Routine Document G02CFF.1

NAG Library Routine Document E02BCF.1

NAG Fortran Library Routine Document F04CJF.1

E04FDFP.1. NAG Parallel Library Routine Document

Mixture Models and the EM Algorithm

NOI 2012 TASKS OVERVIEW

2 3. Syllabus Time Event 9:00{10:00 morning lecture 10:00{10:30 morning break 10:30{12:30 morning practical session 12:30{1:30 lunch break 1:30{2:00 a

Page 1 of 7. Date: 1998/05/31 To: WG5 From: J3/interop Subject: Interoperability syntax (Part 1) References: J3/98-132r1, J3/98-139

NAG Library Function Document nag_rgsn_matrix_multi_normal (g05lyc)

NAG Library Routine Document F08BVF (ZTZRZF)

Introduction to Homogeneous coordinates

All use is subject to licence. See For any commercial application, a separate license must be signed.

NAG Library Routine Document G13DMF.1

TAGUCHI TECHNIQUES FOR 2 k FRACTIONAL FACTORIAL EXPERIMENTS

It can be confusing when you type something like the expressions below and get an error message. a range variable definition a vector of sine values

2.3 Algorithms Using Map-Reduce

Shape spaces. Shape usually defined explicitly to be residual: independent of size.

Chapter 18 out of 37 from Discrete Mathematics for Neophytes: Number Theory, Probability, Algorithms, and Other Stuff by J. M. Cargal.

GAMs semi-parametric GLMs. Simon Wood Mathematical Sciences, University of Bath, U.K.

NAG Library Routine Document D02HBF.1

H. W. Kuhn. Bryn Mawr College

Goals for This Lecture:

Introduction to Modern Fortran

Lecture 3: Camera Calibration, DLT, SVD

NAG Library Function Document nag_rand_copula_clayton (g05rhc)

NAG Fortran Library Routine Document G02HKF.1

Matrices 4: use of MATLAB

D-BAUG Informatik I. Exercise session: week 5 HS 2018

AN INTRODUCTION TO FORTRAN 90 LECTURE 2. Consider the following system of linear equations: a x + a x + a x = b

General Instructions. Questions

C, C++, Fortran: Basics

NAG Library Routine Document F08ZNF (ZGGLSE)

Interfacing With Other Programming Languages Using Cython

NAG Library Routine Document G12ABF.1

University of Florida CISE department Gator Engineering. Clustering Part 2

NAG Fortran Library Routine Document F04BJF.1

Scaling Techniques in Political Science

NAG Library Routine Document H02CFF.1

Transcription:

Multivariate Analysis Module Contents Module 28.3: nag mv rotation Rotations nag mv rotation contains a procedure to compute rotations for sets of data values. Contents Introduction.............................................................. 28.3.3 Procedures nag orthomax........................................................................... 28.3.5 Computes orthogonal rotation, using a generalized orthomax rotations Examples Example 1: Calculation of the Varimax Rotation......................................... 28.3.9 References................................................................ 28.3.11 [NP3506/4] Module 28.3: nag mv rotation 28.3.1

Module Contents Multivariate Analysis 28.3.2 Module 28.3: nag mv rotation [NP3506/4]

Multivariate Analysis Module Introduction There are two principal reasons for using rotations: Introduction (a) simplifying the structure to aid interpretation of derived variables, or (b) comparing two or more data sets or sets of derived variables. The most common type of rotations used for (a) are orthogonal rotations. If Λ is the p by k loading matrix from a variable-directed multivariate method, then the rotations are selected such that the elements, λ ij, of the rotated loading matrix, Λ, are either relatively large or small. For (b) Procrustes rotations are used. Let A and B be two l by m matrices, which can be considered as representing l points in m dimensions. One example is if A is the loading matrix from a variable-directed multivariate method and B is a hypothesised pattern matrix. In order to try to match the points in A and B there are three steps: translate so that centroids of both matrices are at the origin, find a rotation that minimizes the sum of squared distances between corresponding points of the matrices, scale the matrices. For a more detailed description, see Krzanowski [1]. The procedures in nag fac analysis and nag canon analysis may reduce the dimensionality of the data from m variables to a smaller number, k, of derived variables that can adequately represent the data. In general these k derived variables will be unique only up to an orthogonal rotation. Therefore it may be useful to see if there exist suitable rotations of these variables that lead to a simple interpretation of the new variables in terms of the original variables. Only one procedure is available at this release. nag orthomax calculates the orthogonal rotations that satisfy a generalised orthomax criterion. [NP3506/4] Module 28.3: nag mv rotation 28.3.3

Module Introduction Multivariate Analysis 28.3.4 Module 28.3: nag mv rotation [NP3506/4]

Multivariate Analysis nag orthomax Procedure: nag orthomax 1 Description nag orthomax calculates the orthogonal rotations for a matrix of loadings, using a generalised orthomax criterion. 2 Usage USE nag mv rotation CALL nag orthomax(loading, rotated loading [, optional arguments]) 3 Arguments Note. All array arguments are assumed-shape arrays. The extent in each dimension must be exactly that required by the problem. Notation such as x(n) is used in the argument descriptions to specify that the array x must have exactly n elements. This procedure derives the values of the following problem parameters from the shape of the supplied arrays. m 1 the number of variables. k 1 the number of factors. 3.1 Mandatory Arguments loading(m, k) real(kind=wp), intent(in) Input: loading(i, j) must contain the loading for the ith variable on the jth factor, for i = 1, 2,..., m and j = 1, 2,..., k. rotated loading(m, k) real(kind=wp), intent(out) Output: the rotated loading, Λ. The element rotated loading(i, j) contains the rotated loading for the ith variable on the jth factor, for i = 1, 2,..., m and j = 1, 2,..., k. 3.2 Optional Arguments Note. Optional arguments must be supplied by keyword, not by position. The order in which they are described below may differ from the order in which they occur in the argument list. rotation(k, k) real(kind=wp), intent(out), optional Output: the matrix of rotations. gamma real(kind=wp), intent(in), optional Input: the criterion constant, γ, with γ = 1.0 giving varimax rotations and γ = 0.0 giving quartimax rotations. Default: gamma = 0.0. Constraints: gamma 0.0. row std logical, intent(in), optional Input: specifies whether the matrix of loadings is to be row standardised before rotation: if row std =.true., the loadings are row standardised; if row std =.false., the loadings are unstandardised. Default: row std =.true.. [NP3506/4] Module 28.3: nag mv rotation 28.3.5

nag orthomax Multivariate Analysis tol real(kind=wp), intent(in), optional Input: specifies the accuracy required. The iteration is stopped when the change in V is less than tol. Default: tol = 0.01 SQRT(EPSILON(1.0 wp)). Constraints: EPSILON(1.0 wp) tol < 1.0. max iter integer, intent(in), optional Input: specifies the maximum number of iterations. Default: max iter = 50. error type(nag error), intent(inout), optional The NAG fl 90 error-handling argument. See the Essential Introduction, or the module document nag error handling (1.2). You are recommended to omit this argument if you are unsure how to use it. If this argument is supplied, it must be initialized by a call to nag set error before this procedure is called. 4 Error Codes Fatal errors (error%level = 3): error%code Description 301 An input argument has an invalid value. 302 An array argument has an invalid shape. 303 Array arguments have inconsistent shapes. 320 The procedure was unable to allocate enough memory. Failures (error%level = 2): error%code Description 201 The algorithm has failed to converge. Convergence may be obtained by increasing the values of either tol or max iter. 5 Examples of Usage A complete example of the use of this procedure appears in Example 1 of this module document. 6 Further Comments 6.1 Mathematical Background Let Λ be the m by k matrix of loadings from a variable-directed multivariate method, i.e.,canonical variate analysis or factor analysis. This matrix represents the relationship between the original m variables and the k orthogonal linear combinations of these variables, the canonical variates or factors. The latter are only unique up to a rotation in the k-dimensional space they define. A rotation can then be found that simplifies the structure of the matrix of loadings, and hence the relationship between the original and the derived variables. That is the elements, λ ij, of the rotated matrix, Λ, are either relatively large or small. The rotations may be found by maximizing the criterion V = k j=1 i=1 m (λ ij) 4 γ m ( k m ) 2 (λ ij) 2, j=1 i=1 28.3.6 Module 28.3: nag mv rotation [NP3506/4]

Multivariate Analysis nag orthomax where the constant γ gives a family of rotations with γ = 1 giving varimax rotations and γ = 0 giving quartimax rotations. It is generally advised that factor loadings should be standardised, so that the sum of squared elements for each row is one, before computing the rotations. The matrix of rotations, R, such that Λ = ΛR, is computed using first an algorithm based on that described by Cooley and Lohnes [2], which involves the pairwise rotation of the factors. 6.2 Accuracy The accuracy is determined by the value of the argument tol. [NP3506/4] Module 28.3: nag mv rotation 28.3.7

nag orthomax Multivariate Analysis 28.3.8 Module 28.3: nag mv rotation [NP3506/4]

Multivariate Analysis Example 1 Example 1: Calculation of the Varimax Rotation The example is taken from Lawley and Maxwell [3]. The results from a factor analysis of ten variables using three factors are input and rotated using varimax rotations without standardising rows. 1 Program Text Note. The listing of the example program presented below is double precision. Single precision users are referred to Section 5.2 of the Essential Introduction for further information. PROGRAM nag_mv_rotation_ex01! Example Program Text for nag_mv_rotation! NAG fl90, Release 4. NAG Copyright 2000.!.. Use Statements.. USE nag_examples_io, ONLY : nag_std_in, nag_std_out USE nag_write_mat, ONLY : nag_write_gen_mat USE nag_mv_rotation, ONLY : nag_orthomax!.. Implicit None Statement.. IMPLICIT NONE!.. Intrinsic Functions.. INTRINSIC KIND!.. Parameters.. INTEGER, PARAMETER :: wp = KIND(1.0D0)!.. Local Scalars.. INTEGER :: i, k, p REAL (wp) :: gamma!.. Local Arrays.. REAL (wp), ALLOCATABLE :: loading(:,:), rotated_loading(:,:), & rotation(:,:)!.. Executable Statements.. WRITE (nag_std_out,*) Example Program Results for nag_mv_rotation_ex01 READ (nag_std_in,*)! Skip heading in data file READ (nag_std_in,*) p, k, gamma ALLOCATE (loading(p,k),rotated_loading(p,k), & rotation(k,k))! Allocate storage READ (nag_std_in,*) (loading(i,:),i=1,p) CALL nag_orthomax(loading,rotated_loading,rotation=rotation, & row_std=.false.,gamma=gamma) WRITE (nag_std_out,*) CALL nag_write_gen_mat(rotated_loading,format= f9.3, & title= Rotated factor loading ) WRITE (nag_std_out,*) CALL nag_write_gen_mat(rotation,format= f9.3,title= Rotation matrix ) DEALLOCATE (rotation,rotated_loading,loading)! Deallocate storage END PROGRAM nag_mv_rotation_ex01 [NP3506/4] Module 28.3: nag mv rotation 28.3.9

Example 1 Multivariate Analysis 2 Program Data Example Program Data for nag_mv_rotation_ex01 10 3 1.0 : p, k, gamma 0.788-0.152-0.352 0.874 0.381 0.041 0.814-0.043-0.213 0.798-0.170-0.204 0.641 0.070-0.042 0.755-0.298 0.067 0.782-0.221 0.028 0.767-0.091 0.358 0.733-0.384 0.229 0.771-0.101 0.071 : loading 3 Program Results Example Program Results for nag_mv_rotation_ex01 Rotated factor loading 0.329-0.289-0.759 0.849-0.273-0.340 0.450-0.327-0.633 0.345-0.397-0.657 0.453-0.276-0.370 0.263-0.615-0.464 0.332-0.561-0.485 0.472-0.684-0.183 0.209-0.754-0.354 0.423-0.514-0.409 Rotation matrix 0.633-0.534-0.560 0.758 0.573 0.311 0.155-0.622 0.768 28.3.10 Module 28.3: nag mv rotation [NP3506/4]

Multivariate Analysis References References [1] Krzanowski W J (1990) Principles of Multivariate Analysis Oxford University Press [2] Cooley W C and Lohnes P R (1971) Multivariate Data Analysis Wiley [3] Lawley D N and Maxwell A E (1971) Factor Analysis as a Statistical Method Butterworths (2nd Edition) [NP3506/4] Module 28.3: nag mv rotation 28.3.11