naginterfaces.library.mv.factor_score¶
- naginterfaces.library.mv.factor_score(method, rotate, fl, psi, e, r)[source]¶
factor_score
computes factor score coefficients from the result of fitting a factor analysis model by maximum likelihood as performed byfactor()
.For full information please refer to the NAG Library document for g03cc
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g03/g03ccf.html
- Parameters
- methodstr, length 1
Indicates which method is to be used to compute the factor score coefficients.
The regression method is used.
Bartlett’s method is used.
- rotatestr, length 1
Indicates whether a rotation is to be applied.
A rotation will be applied to the coefficients and the rotation matrix, , must be given in .
No rotation is applied.
- flfloat, array-like, shape
, the matrix of unrotated factor loadings as returned by
factor()
.- psifloat, array-like, shape
The diagonal elements of , as returned by
factor()
.- efloat, array-like, shape
The eigenvalues of the matrix , as returned by
factor()
.- rfloat, array-like, shape
Note: the required extent for this argument in dimension 1 is determined as follows: if : ; otherwise: .
Note: the required extent for this argument in dimension 2 is determined as follows: if : ; if : ; otherwise: .
If , must contain the orthogonal rotation matrix, , as returned by
rot_orthomax()
.If , need not be set.
- Returns
- fsfloat, ndarray, shape
The matrix of factor score coefficients, . contains the factor score coefficient for the th factor and the th observed variable, for , for .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry,
Constraint: or .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- Notes
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
A factor analysis model aims to account for the covariances among variables, observed on individuals, in terms of a smaller number, , of unobserved variables or factors. The values of the factors for an individual are known as factor scores.
factor()
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 matrix of factor score coefficients, , is formed. The estimated vector of factor scores, , is then given by:where is the vector of observed variables for an individual.
There are two commonly used methods of obtaining factor score coefficients.
The regression method:
and Bartlett’s method:
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
factor()
. Further, for models fitted byfactor()
,where is the diagonal matrix of eigenvalues of the matrix , as described in
factor()
.The factors may be orthogonally rotated using an orthogonal rotation matrix, , as computed by
rot_orthomax()
. The factor scores for the rotated matrix are then given by .
- References
Lawley, D N and Maxwell, A E, 1971, Factor Analysis as a Statistical Method, (2nd Edition), Butterworths