# restrictions2model: Map free parameters to matrices In FAiR: Factor Analysis in R

## 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 S4 generic function takes a numeric vector of free parameters and manipulates it into the matrices that are typical when estimating a factor analysis model. There is little need to call it directly. Various methods are defined for the `restrictions` object, corresponding to different kinds of factor analysis models; see `FAiR-package`.

## Usage

 ```1 2``` ```## S4 method for signature 'restrictions,manifest' restrictions2model(par, restrictions, manifest, lower, mapping_rule) ```

## Arguments

 `par` A numeric vector containing values for all the free parameters to be estimated, which corresponds to the `par` argument for `genoud` and for `optim`. `restrictions` An object of `restrictions-class`. `manifest` An object of `manifest-class`. `lower` A small numeric scalar indicating the lower bound for positive definiteness or minimum uniqueness; see the corresponding argument to `Factanal`. `mapping\_rule` a logical that controls whether the mapping rule is invoked in semi-exploratory factor analysis. This argument is used to circumvent the mapping rule in some circumstances, like when the function is called indirectly by `optim`

## Details

This function is called internally by `Factanal` thousands of times during the course of the optimization. Let the factor analysis model in the population be

Sigma = Omega(beta Phi beta' + Theta)Omega

and let theta be a vector of all the free parameters in the factor analysis model. The `restrictions2model` methods are essentially a mapping from theta to the free elements of beta, Phi, and Omega. The methods are currently defined on the `restrictions` argument, which is fairly skeletal at the outset, is filled in by the body of the `restrictions2model` method using a bunch of calls to the `make_parameter-methods`.

The `restrictions2model` method can (and does) also do some checking of whether the parameters in `par` are admissable in the context of a factor analysis model. For each admissability check, if `par` is admissable, it should receive the value of -1.0 in a numeric vector whose length is equal to the number of admissability checks. If `par` is inadmissable with respect to some check, it should receive a value greater than -1.0. This numeric vector should also be returned as an element of a list called `"criteria"`.

## Value

A list with exactly two elements named

 `criteria` a numeric vector `restrictions` a filled-in version of the `restrictions` object

## Methods

The arguments that are part of the signature are `restrictions` and `manifest`. Methods are currently only defined for objects of class `"manifest.basic"`, which are inherited by objects of class `"manifest.data"` and `"manifest.data.mcd"`. There are methods for each of the classes that inherit from `restrictions-class`, except for `"restrictions.factanal"`, which does not utilize the `restrictions2model` mechanism.

There are also two arguments that are not part of the signature. The first is `par`, which is a numeric vector of free parameters and is conceptually similar to the `par` argument to `optim`. The second is `lower`, which is a small positive number that is used as a threshold for positive-definiteness of various matrices.

## Author(s)

Ben Goodrich

`make_parameter`, `restrictions-class`
 `1` ``` showMethods("restrictions2model") ```