Factanal is just a wrapper around a call to
genoud in the rgenoud package. These S4
generic functions are passed to various arguments of
genoud as part of the optimization process. With
the exception of the methods for create_start, it would be very
unusual for any of these methods to be called directly by the user.
"fitS4"(par, restrictions, manifest, lower, mapping_rule)
"bfgs_fitS4"(par, restrictions, manifest, helper, lower)
"gr_fitS4"(par, restrictions, manifest, helper, lower)
"bfgs_helpS4"(initial, restrictions, manifest, done, lower)
"create_start"(number, start, restrictions, manifest, reject)par.restrictions-class.manifest-class.Factanal.FALSE when called by
optim.bfgs_fitS4
and gr_fitS4 methods that is passed to the BFGShelp argument for
genoud.BFGShelp argument to genoud.bfgs_fitS4 and
gr_fitS4restrictions-class, although in
many cases the methods are simply inherited. Currently, there are only methods for
objects of class "manifest.basic", which are inherited by objects of class
"manifest.data" and "manifest.data.mcd". However, it is possible to
tailor methods for different flavors of manifest-class or to create
new classes that inherit from restrictions-class and write (some)
methods for them.fitS4 method is responsible for producing a complete numeric vector of
fit criteria and is passed to the fn argument of genoud.
The default method simply calls restrictions2model and then calls an internal
function that evaluates all the functions in the criteria slot of the object of
restrictions-class. The bfgs_fitS4 method produces a scalar fit criterion, and this
method is passed to the BFGSfn argument of genoud
and is in turned passed to the fn argument of optim. Usually,
this criterion is the last criterion produced by the fitS4 method, which is the
discrepancy function. The gr_fitS4 method produces the gradient
of the function defined by the bfgs_fitS4 method under traditional maximum
likelihood estimation; otherwise it is an internal function. Either way, this function
is passed to the gr argument of genoud and
optim. Both bfgs_fitS4 and gr_fitS4 take an
argument called helper, which is produced by the bfgs_helpS4
method and corresponds to the BFGShelp argument of
genoud. The BFGShelp method produces a list
that contains information about the initial value of the genetic individual
when optim is called. The bfgs_fitS4 methods and gr_fitS4
methods can behave differently depending on the contents of helper.
The create_start method creates a matrix of starting values that is
then passed to the starting.values argument of
genoud. If you think the starting values are inadequate
in a particular situation, it is much easier to create a matrix of starting
values in the global environment and pass it through the ... of
Factanal to the starting.values argument of
genoud yourself. See Factanal for details
on doing so.
Factanal, manifest-class, restrictions-class and
genoud showMethods("fitS4")
showMethods("bfgs_fitS4")
showMethods("gr_fitS4")
showMethods("bfgs_helpS4")
showMethods("create_start")
Run the code above in your browser using DataLab