mxMatrix(type = "Full", nrow = NA, ncol = NA,
free = FALSE, values = NA, labels = NA, lbound = NA,
ubound = NA, byrow = getOption('mxByrow'), dimnames = NA, name = NA,
condenseSlots=getOption('mxCondenseMatrixSlots'))
NA
.NA
.FALSE
(default), the mxAlgebra()
, mxBounds()
, mxConstraint()
and mxModel()
functions.'data.'
can be used if the MxMatrix is to be used in an MxModel object that has a raw dataset (i.e., an MxData object of type="raw"
). Such a label instructs OpenMx to use a particular column of the raw dataset to fill in the value of that element. For historical reasons, the variable contained in that column is called a "definition variable." For example, if an MxMatrix element has the label 'data.x'
, then OpenMx will use the first value of the data column named "x" when evaluating the fitfunction for the first row, and will use the second value of column "x" when evaluating the fitfunction for the second row, and so on. After the call to mxRun()
, the values for elements labeled with 'data.x'
are returned as the value from the first (i.e., first before any automated sorting is done) element of column "x" in the data. Objects created by the mxMatrix()
function are of a specific
When
# Create a 3 x 3 identity matrix
idenMatrix <- mxMatrix(type = "Iden", nrow = 3,
ncol = 3, name = "I")
# Create a full 4 x 2 matrix from existing
# value matrix with all free parameters
vals <- matrix(1:8, nrow = 4)
fullMatrix <- mxMatrix(type = "Full", values = vals,
free = TRUE, name = "foo")
# Create a 3 x 3 symmetric matrix with free off-
# diagonal parameters and starting values
symmMatrix <- mxMatrix(type = "Symm", nrow = 3, ncol = 3,
free = c(FALSE, TRUE, TRUE, FALSE, TRUE, FALSE),
values = c(1, .8, .8, 1, .8, 1),
labels = c(NA, "free1", "free2", NA, "free3", NA),
name = "bar")
Run the code above in your browser using DataLab