hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_mv_factor_score (g03cc)

Purpose

nag_mv_factor_score (g03cc) computes factor score coefficients from the result of fitting a factor analysis model by maximum likelihood as performed by nag_mv_factor (g03ca).

Syntax

[fs, ifail] = g03cc(method, rotate, fl, psi, e, r, 'nvar', nvar, 'nfac', nfac)
[fs, ifail] = nag_mv_factor_score(method, rotate, fl, psi, e, r, 'nvar', nvar, 'nfac', nfac)

Description

A factor analysis model aims to account for the covariances among pp variables, observed on nn individuals, in terms of a smaller number, kk, of unobserved variables or factors. The values of the factors for an individual are known as factor scores. nag_mv_factor (g03ca) fits the factor analysis model by maximum likelihood and returns the estimated factor loading matrix, ΛΛ, and the diagonal matrix of variances of the unique components, ΨΨ. To obtain estimates of the factors, a pp by kk matrix of factor score coefficients, ΦΦ, is formed. The estimated vector of factor scores, f^, is then given by:
= xTΦ,
f^=xTΦ,
where xx is the vector of observed variables for an individual.
There are two commonly used methods of obtaining factor score coefficients.
The regression method:
Φ = Ψ1Λ(I + ΛTΨ1Λ)1,
Φ=Ψ-1Λ(I+ΛTΨ-1Λ) -1,
and Bartlett's method:
Φ = Ψ1Λ(ΛTΨ1Λ)1.
Φ=Ψ-1Λ(ΛTΨ-1Λ) -1.
See Lawley and Maxwell (1971) for details of both methods. In the regression method as given above, it is assumed that the factors are not correlated and have unit variance; this is true for models fitted by nag_mv_factor (g03ca). Further, for models fitted by nag_mv_factor (g03ca),
ΛTΨ1Λ = ΘI,
ΛTΨ-1Λ=Θ-I,
where ΘΘ is the diagonal matrix of eigenvalues of the matrix S*S*, as described in nag_mv_factor (g03ca).
The factors may be orthogonally rotated using an orthogonal rotation matrix, RR, as computed by nag_mv_rot_orthomax (g03ba). The factor scores for the rotated matrix are then given by ΛRΛR.

References

Lawley D N and Maxwell A E (1971) Factor Analysis as a Statistical Method (2nd Edition) Butterworths

Parameters

Compulsory Input Parameters

1:     method – string (length ≥ 1)
Indicates which method is to be used to compute the factor score coefficients.
method = 'R'method='R'
The regression method is used.
method = 'B'method='B'
Bartlett's method is used.
Constraint: method = 'B'method='B' or 'R''R'.
2:     rotate – string (length ≥ 1)
Indicates whether a rotation is to be applied.
rotate = 'R'rotate='R'
A rotation will be applied to the coefficients and the rotation matrix, RR, must be given in r.
rotate = 'U'rotate='U'
No rotation is applied.
Constraint: rotate = 'R'rotate='R' or 'U''U'.
3:     fl(ldfl,nfac) – double array
ldfl, the first dimension of the array, must satisfy the constraint ldflnvarldflnvar.
ΛΛ, the matrix of unrotated factor loadings as returned by nag_mv_factor (g03ca).
4:     psi(nvar) – double array
nvar, the dimension of the array, must satisfy the constraint nvarnfacnvarnfac.
The diagonal elements of ΨΨ, as returned by nag_mv_factor (g03ca).
Constraint: psi(i) > 0.0psii>0.0, for i = 1,2,,pi=1,2,,p.
5:     e(nvar) – double array
nvar, the dimension of the array, must satisfy the constraint nvarnfacnvarnfac.
The eigenvalues of the matrix S*S*, as returned by nag_mv_factor (g03ca).
Constraint: e(i) > 1.0ei>1.0, for i = 1,2,,pi=1,2,,p.
6:     r(ldr, : :) – double array
The first dimension, ldr, of the array r must satisfy
  • if rotate = 'R'rotate='R', ldrnfacldrnfac;
  • otherwise 11.
The second dimension of the array must be at least 11 if rotate = 'U'rotate='U' and at least nfacnfac if rotate = 'R'rotate='R'
If rotate = 'R'rotate='R', r must contain the orthogonal rotation matrix, RR, as returned by nag_mv_rot_orthomax (g03ba).
If rotate = 'U'rotate='U', r need not be set.

Optional Input Parameters

1:     nvar – int64int32nag_int scalar
Default: The dimension of the arrays psi, e and the first dimension of the array fl. (An error is raised if these dimensions are not equal.)
pp, the number of observed variables in the factor analysis.
Constraint: nvarnfacnvarnfac.
2:     nfac – int64int32nag_int scalar
Default: The second dimension of the array fl.
kk, the number of factors in the factor analysis.
Constraint: nfac1nfac1.

Input Parameters Omitted from the MATLAB Interface

ldfl ldr ldfs wk

Output Parameters

1:     fs(ldfs,nfac) – double array
ldfsnvarldfsnvar.
The matrix of factor score coefficients, ΦΦ. fs(i,j)fsij contains the factor score coefficient for the jjth factor and the iith observed variable, for i = 1,2,,pi=1,2,,p and j = 1,2,,kj=1,2,,k.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,nfac < 1nfac<1,
ornvar < nfacnvar<nfac,
orldfl < nvarldfl<nvar,
orldfs < nvarldfs<nvar,
orrotate = 'R'rotate='R' and ldr < nfacldr<nfac,
ormethod'R'method'R' or 'B''B',
orrotate'R'rotate'R' or 'U''U'.
  ifail = 2ifail=2
On entry,a value of psi0.0psi0.0,
ora value of e1.0e1.0.

Accuracy

Accuracy will depend on the accuracy requested when computing the estimated factor loadings using nag_mv_factor (g03ca).

Further Comments

If principal component analysis is required the function nag_mv_prin_comp (g03aa) computes the principal component scores directly. Hence, the factor score coefficients are not needed.

Example

function nag_mv_factor_score_example
method = 'R';
rotate = 'U';
fl = [0.5533188537924767, -0.4285636478848139;
     0.568155945618757, -0.2883165515607369;
     0.3921781680583233, -0.4499647969874735;
     0.7404217621764928, 0.2728004512944507;
     0.7238701315235972, 0.2113108264190836;
     0.5953586397783871, 0.1316911981935982];
psi = [0.5101714468054336;
     0.5940723866877339;
     0.6437279642693183;
     0.3773554593674197;
     0.4313596544519335;
     0.6282055268211231];
e = [5.61418330106997;
     2.142797556801369;
     1.092257889179389;
     1.026411127333595;
     0.9908235560038364;
     0.8905078592462671];
r = [0.001066610312409233];
[fs, ifail] = nag_mv_factor_score(method, rotate, fl, psi, e, r)
 

fs =

    0.1932   -0.3920
    0.1703   -0.2265
    0.1085   -0.3262
    0.3495    0.3374
    0.2989    0.2286
    0.1688    0.0978


ifail =

                    0


function g03cc_example
method = 'R';
rotate = 'U';
fl = [0.5533188537924767, -0.4285636478848139;
     0.568155945618757, -0.2883165515607369;
     0.3921781680583233, -0.4499647969874735;
     0.7404217621764928, 0.2728004512944507;
     0.7238701315235972, 0.2113108264190836;
     0.5953586397783871, 0.1316911981935982];
psi = [0.5101714468054336;
     0.5940723866877339;
     0.6437279642693183;
     0.3773554593674197;
     0.4313596544519335;
     0.6282055268211231];
e = [5.61418330106997;
     2.142797556801369;
     1.092257889179389;
     1.026411127333595;
     0.9908235560038364;
     0.8905078592462671];
r = [0.001066610312409233];
[fs, ifail] = g03cc(method, rotate, fl, psi, e, r)
 

fs =

    0.1932   -0.3920
    0.1703   -0.2265
    0.1085   -0.3262
    0.3495    0.3374
    0.2989    0.2286
    0.1688    0.0978


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013