OpenMx Developer Forums

Posted on
Picture of user. mspiegel Joined: 07/31/2009

added 'dimnames' argument to ML and FIML objective functions

We added an optional 'dimnames' argument to the functions mxFIMLObjective() and mxMLObjective(). The argument expects a vector of character, such as c('foo', 'bar', 'baz'). The objective function uses this vector to populate the column names of the means vector, and the row and column names of the covariance matrix. With the 'dimnames' argument it is no longer necessary to explicitly specify the dimnames of the means and covariances, although it is still possible.

Posted on
Picture of user. mspiegel Joined: 07/31/2009

see the parenthesis of R expressions

The following function will let you see the order of operations applied to R expressions.

addParens <- function(expression) {
   input <- match.call()$expression
   return(addParensHelper(input))
}

addParensHelper <- function(expression) {
   if (length(expression) == 1) {
      return(expression)
   } else if (expression[[1]] == '(') {
      return(expression)
   } else {
      for(i in 2:length(expression)) {
         expression[[i]] <- addParensHelper(expression[[i]])
      }
      return(substitute((x), list(x = expression)))
   }
}

Posted on
Picture of user. tbates Joined: 07/31/2009

extracting standard errors (se) from $output

Hi there,
I can't see the SEs in $output... I guess that means they are computed by summary()?
But I also don't see how to extract them programatically from the output of summary(fit)

none of these work:
x = summary(fit)
x$SE; x$standard_error; x$error_estimate

any clues?

Posted on
Picture of user. kpreacher Joined: 08/23/2009

Path diagrams for multilevel SEM

Just wanted to get some discussion going.

The best method I have seen for diagramming multilevel SEM appears in Mehta and Neale (2005). Their method is very compact, and maps completely onto the matrix expression for two-level models. Random slopes are represented as latent variables with definition variables as loadings. The method has the further benefit of being "collapsible" in that variables treated in a redundant manner can be collapsed into single variables without becoming inconsistent with the matrix expression.

Posted on
Picture of user. pdeboeck Joined: 08/04/2009

Reading Data

A forum regarding reading in data

Posted on
Picture of user. mspiegel Joined: 07/31/2009

OpenMx script requirements

The files UnivariateTwinAnalysis20090925.R, Twin_independent_path_general_factor.R, TwinAnalysis_Multivariate_Matrix_Raw.R, and NTF_design.R are being moved to the models/failing directory in preparation for the next closed beta release. All files in the test suite must follow the following guidelines:

  • Never use setwd(). It's not going to work on my machine.
  • Never use source(). The point of a demo is that the entire example is in a single file.
Posted on
No user picture. Hermine Joined: 07/31/2009

Error in fitting submodels

I thought that only matrices with changes (dropping/constraining parameters) have to be specified in a submodel [see line 62+ of attached script] , when the full model name is the first argument of the new mxModel command but somehow it doesn't seem to find the MZ.objective anymore. Is this a new bug? I thought this was working before.

Posted on
No user picture. Hermine Joined: 07/31/2009

Link Documentation directly to Example Scripts/Data

Forums

I would like to link all the OpenMx scripts directly to the documentation, but don't know where they physically reside, and can't find them from the website.

Ideally, if a user clicks on a (linked) script, it should open immediately in their R application so it can be run with just two clicks (assuming the user has R installed). Could/should this be done and if so, how?

Posted on
Picture of user. mspiegel Joined: 07/31/2009

Square bracket substitution implemented

Square bracket substitution has been implemented in the subversion repository. This is a feature that allows you to construct MxMatrix objects, and within the labels of a matrix use a string of the form "foo[row,col]" where 'foo' refers to another MxMatrix or MxAlgebra and 'row','col' must be numeric literals. It is very important to keep in mind that this only applies to matrix labels. You cannot use this notation in mxAlgebra expressions. Here are some examples of this notation:

require(OpenMx)
A <- mxMatrix('Full', 1, 1, values = 1, name = 'A')
Posted on
Picture of user. tbates Joined: 07/31/2009

Capability to offer a vector to value and free slots in MXMatrix objects

This works

Chol    = mxMatrix(type="Full", 2,2, free=c(TRUE,TRUE,FALSE,TRUE), values=c(1,.2,0,1))

But this fails

Chol@free=c(TRUE,FALSE,FALSE,TRUE)
Chol@values=c(1,0,0,1)

It would be nice, given that we can create the free and values slots with vectors, if we could also update them iwth vectors, using the pre-existing nrow and ncol of the MxMatrix to do this:

vec2MatFormxMatrix <- function(oldMat, newVec) {
 newMat = matrix(data=newVec, nrow=nrow(oldMat), ncol=ncol(oldMat) )
 return(newMat)
}

newVec =c(TRUE,FALSE,FALSE,TRUE)