Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mxComputeGradientDescent

Optimize parameters using a gradient descent optimizer


Description

This optimizer does not require analytic derivatives of the fit function. The fully open-source CRAN version of OpenMx offers 2 choices, CSOLNP and SLSQP (from the NLOPT collection). The OpenMx Team's version of OpenMx offers the choice of three optimizers: CSOLNP, SLSQP, and NPSOL.

Usage

mxComputeGradientDescent(
  freeSet = NA_character_,
  ...,
  engine = NULL,
  fitfunction = "fitfunction",
  verbose = 0L,
  tolerance = NA_real_,
  useGradient = deprecated(),
  warmStart = NULL,
  nudgeZeroStarts = mxOption(NULL, "Nudge zero starts"),
  maxMajorIter = NULL,
  gradientAlgo = deprecated(),
  gradientIterations = deprecated(),
  gradientStepSize = deprecated()
)

Arguments

freeSet

names of matrices containing free parameters.

...

Not used. Forces remaining arguments to be specified by name.

engine

specific 'CSOLNP', 'SLSQP', or 'NPSOL'

fitfunction

name of the fitfunction (defaults to 'fitfunction')

verbose

integer. Level of run-time diagnostic output. Set to zero to disable

tolerance

how close to the optimum is close enough (also known as the optimality tolerance)

useGradient

[Soft-deprecated]

warmStart

a Cholesky factored Hessian to use as the NPSOL Hessian starting value (preconditioner)

nudgeZeroStarts

whether to nudge any zero starting values prior to optimization (default TRUE)

maxMajorIter

maximum number of major iterations

gradientAlgo

[Soft-deprecated]

gradientIterations

[Soft-deprecated]

gradientStepSize

[Soft-deprecated]

Details

All three optimizers can use analytic gradients, and only NPSOL uses warmStart. To customize more options, see mxOption.

References

Luenberger, D. G. & Ye, Y. (2008). Linear and nonlinear programming. Springer.

Examples

data(demoOneFactor)
factorModel <- mxModel(name ="One Factor",
  mxMatrix(type="Full", nrow=5, ncol=1, free=FALSE, values=0.2, name="A"),
    mxMatrix(type="Symm", nrow=1, ncol=1, free=FALSE, values=1, name="L"),
    mxMatrix(type="Diag", nrow=5, ncol=5, free=TRUE, values=1, name="U"),
    mxAlgebra(expression=A %*% L %*% t(A) + U, name="R"),
  mxExpectationNormal(covariance="R", dimnames=names(demoOneFactor)),
  mxFitFunctionML(),
    mxData(observed=cov(demoOneFactor), type="cov", numObs=500),
     mxComputeSequence(steps=list(
     mxComputeGradientDescent(),
     mxComputeNumericDeriv(),
     mxComputeStandardError(),
     mxComputeHessianQuality()
    )))
factorModelFit <- mxRun(factorModel)
factorModelFit$output$conditionNumber # 29.5

OpenMx

Extended Structural Equation Modelling

v2.19.5
Apache License (== 2.0)
Authors
Steven M. Boker [aut], Michael C. Neale [aut], Hermine H. Maes [aut], Michael J. Wilde [ctb], Michael Spiegel [aut], Timothy R. Brick [aut], Ryne Estabrook [aut], Timothy C. Bates [aut], Paras Mehta [ctb], Timo von Oertzen [ctb], Ross J. Gore [aut], Michael D. Hunter [aut], Daniel C. Hackett [ctb], Julian Karch [ctb], Andreas M. Brandmaier [ctb], Joshua N. Pritikin [aut, cre], Mahsa Zahery [aut], Robert M. Kirkpatrick [aut], Yang Wang [ctb], Ben Goodrich [ctb], Charles Driver [ctb], Massachusetts Institute of Technology [cph], S. G. Johnson [cph], Association for Computing Machinery [cph], Dieter Kraft [cph], Stefan Wilhelm [cph], Sarah Medland [cph], Carl F. Falk [cph], Matt Keller [cph], Manjunath B G [cph], The Regents of the University of California [cph], Lester Ingber [cph], Wong Shao Voon [cph], Juan Palacios [cph], Jiang Yang [cph], Gael Guennebaud [cph], Jitse Niesen [cph]
Initial release
2021-03-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.