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

xmuValues

xmuValues: Set values in RAM model, matrix, or path


Description

For models to be estimated, it is essential that path values start at credible values. xmuValues takes on that task for you.

Usage

xmuValues(obj = NA, sd = NA, n = 1, onlyTouchZeros = FALSE)

Arguments

obj

The RAM or matrix mxModel(), or mxMatrix() that you want to set start values for.

sd

Optional Standard Deviation for start values

n

Optional Mean for start values

onlyTouchZeros

Don't alter parameters that have starts (useful to speed umxModify())

Details

xmuValues can set start values for the free parameters in both RAM and Matrix mxModel()s. It can also take an mxMatrix as input. It tries to be smart in guessing starts from the values in your data and the model type.

note: If you give xmuValues a numeric input, it will use obj as the mean, and return a list of length n, with sd = sd.

Value

References

See Also

  • Core functions:

Other Advanced Model Building Functions: umxAlgebra(), umxFixAll(), umxJiggle(), umxRun(), umxThresholdMatrix(), umxUnexplainedCausalNexus(), umx, xmuLabel()

Examples

require(umx)
data(demoOneFactor)
latents = c("G")
manifests = names(demoOneFactor)

# ====================================================================
# = Make an OpenMx model (which will lack start values and labels..) =
# ====================================================================
m1 = mxModel("One Factor", type = "RAM", 
	manifestVars = manifests, latentVars = latents, 
	mxPath(from = latents  , to = manifests),
	mxPath(from = manifests, arrows = 2),
	mxPath(from = latents  , arrows = 2, free = FALSE, values = 1.0),
	mxData(cov(demoOneFactor), type = "cov", numObs=500)
)
mxEval(S, m1) # default variances are jiggled away from near-zero
# Add start values to the model
m1 = xmuValues(m1)
mxEval(S, m1) # plausible variances
umx_print(mxEval(S,m1), 3, zero.print = ".") # plausible variances
xmuValues(14, sd = 1, n = 10) # Return vector of length 10, with mean 14 and sd 1

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

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