Learn R Programming

FAiR (version 0.4-15)

parameter-class: Class "parameter"

Description

It is not necessary to understand this help page if one merely wants to estimate a factor analysis model. This help page is intended for those who want to modify or extend FAiR or otherwise want some idea of how FAiR works “behind the scenes”.

This class is used internally to hold information about the parameters in a factor analysis model.

Arguments

Objects from the Class

Objects can be created by calls of the form new("parameter", ...). However, rarely, if ever, would one want to do so directly because make_restrictions instantiates them and puts them into the slots of an object of restrictions-class.

Slots

The "parameter" class is virtual and has the following slots:
x:
Object of class "ANY" but is a numeric vector or numeric matrix in all known inherited classes. Its elements can be free parameters or parameters that are fixed and not estimated. In the case of the former, the corresponding element of x should be NA. In the case of the latter, the corresponding element of x should be the number that the parameter is fixed to or Inf if the parameter is “fixed” to be a function of other parameters.
free:
Object of class "ANY" but for all known inherited class is a logical vector or logical matrix whose length is the same as the length of x that indicates which elements of x are considered “free” parameters.
num_free:
Integer indicating the number of free parameters in x.
select:
A logical vector indicating which elements of the grand parameter vector correspond to the free elements of x.
invalid:
A numeric scalar that is $0.0$ if the parameters are not invalid and some number other than $0.0$ if the parameters are invalid.
Domains:
an array that is either empty or stacks exactly two matrices that are the same dimension as x. The lower matrix should indicate the lower bound for the parameter and the upper matrix should indicate the upper bound. It is often unnecessary to specify Domains because they are completed by the make_restrictions-methods.
The "parameter.cormat" class extends "parameter" and is used for correlation matrices among primary factors. Hence, x is of class "matrix" and the only free parameters are in the lower triangle; however, not all elements of the lower triangle need to be free parameters. The "parameter.scale" class extends "parameter" and is used for (diagonal) matrices of standard deviations of the outcome variables that pre- and post-multiply the correlation matrix in the “embedded correlation” parameterized currently used for all models in FAiR. Hence, x is of class "numeric" and is the diagonal of such a scale matrix.Typically, all diagonal elements are free but not always, as in the case where some observed variable is designated as a factor, in which case its standard deviation is estimated from the data rather than by the model. The "parameter.coef" class extends "parameter" and is used for primary pattern matrices. Hence, "x" is of class (numeric) "matrix" and its cells may be free (designated by NA) or fixed. It has one additional slot,
equalities:
a list (possibly with zero length) of objects of equality_restriction-class to indicate equality restrictions among some cells of x.
The "parameter.coef.nl" class extends "parameter.coef" and has one additional slot,
nonlinearities:
a function with an argument called "pattern". After x is filled with free parameters and any equality restrictions are resolved, x is passed to this function whose body can enforce other exact restrictions on the cells. For example, one “"fixed"” cell could be the product of other cells. Then, this function must return this primary pattern matrix whose cells are all finite numbers, which will be reinserted into the x slot for later use.
The "parameter.coef.SEFA" class extends "parameter.coef" and is used in semi-exploratory factor analysis. It has two additional slots,
rankcheck:
either "reiersol" or "howe" to indicate which theorem is to be used in checking the rank of submatrices of the primary pattern matrix with exact zeros in a column. See the Details section.
mapping_rule:
a function that defaults to the one documented in mapping_rule and is used to make some cells of x exactly zero. It is possible to define a different function for this slot but see mapping_rule because the underlying code is hard-coded to assume some of the same arguments in some places. This function is called after the cells of x have been filled and any equality restrictions have been resolved and should output a matrix that will be reinserted into the x slot.
squashed:
a logical matrix indicating which cells of the coefficient matrix were squashed to zero by the mapping rule. This slot is typically empty until the model has been estimated, at which point the create_FAobject-methods must fill it.
The "parameter.coef.SEFA.nl" class extends "parameter.coef.SEFA" and has one additional slot,
nonlinearities:
A function, the same as above for the "parameter.coef.nl" class. The function enforcing nonlinear restrictions is called before the mapping rule function.

Methods

A cormat method extracts the x slot of an object of "parameter.cormat". A coef method extracts the x slot of an object that inherits from "parameter.coef". There is no special extractor function for objects of "parameter.scale". There are also show methods. The most important methods are those defined for the make_parameter S4 generic. This function takes two arguments, "par", which is a numeric vector but not part of the signature, and "object", which is an object that inherits from the "parameter" class. The make_parameter methods are defined for each inherited class and basically do two things. First, they do something like this object@x[object@free] <- par[object@select] to fill the free elements of x with corresponding values from "par". Then, these methods often check whether the parameters are collectively admissable under the assumptions of the factor analysis model. If not, the make_parameter method must set the invalid slot to some number that is greater than $-1.0$ and not $0.0$. It is preferable if larger values somehow indicate more flagrant inadmissability, since this number is used as a return value in the lexical optimization process (see genoud). Finally, the make_parameter should return object.

References

Howe, W.G. (1955) Some Contributions to Factor Analysis. Dissertation published as ORNL-1919 by Oak Ridge National Laboratory in Tennessee.

Reiersøl, O. (1950) On the Identifiability of Parameters in Thurstone's Multiple Factor Analysis. Psychometrika, 15, 121--149.

Examples

Run this code
showClass("parameter")
showClass("parameter.cormat")
showClass("parameter.scale")
showClass("parameter.coef")
showClass("parameter.coef.nl")
showClass("parameter.coef.SEFA")
showClass("parameter.coef.SEFA.nl")
showMethods("make_parameter")

Run the code above in your browser using DataLab