# OpenMx General Help

## Create a function to generate mxMatrix and mxAlgebra

I am writing an R function which can create and run an OpenMx model. I can do it in a simple way. Partial codes are shown below. However, I have over 20 definition variables and for each I need corresponding mxAlgebra. I may want to write a function/a loop to generate mxMatrix and mxAlgebra. I've tried a couple of methods, yet none of them worked. The mainly problem is that in the expression of mxAlgebra, I need call the name of corresponding mxMatrix. Thank you in advance!

## Performance issues many algebras

I am currently implementing a new model specification language for longitudinal panel models. As "backend", I use OpenMx. Everything works but it is painfully slow.

- Read more about Performance issues many algebras
- 21 comments
- Log in or register to post comments

## Single Common Factor Model with Some Residual Errors Correlated

## Power estimation for the detection of rG and rE

Specifically, the analysis employed a trivariate Cholesky (AE providing the best fit, with all significant rGs, and one significant rE). The CIs have been calculated for all estimates. The sample is on the small side: 200 same-sex pairs (half MZ, half DZ) and may have been underpowered for the other smaller rEs but I’m not sure what size effect I had enough power to detect.

## How to set the value of a computed parameter to that computed value?

Background and use-case: OpenMx allows us to use labels to set the value of a parameter (matrix cell). Here's a RAM model where I insert the value of covXY into the row 2, column1 of the symmetric path (S) matrix:

m1$S

$labels

x y

x "x_with_x" "covXY[1,1]"

y "covXY[1,1]" "y_with_y"

$values

x y

x 1.198632 0.000000

y 0.000000 2.018483

## Rmpi

Error in { : task 18 failed - "job.num is at least 2."

Calls: %dopar% ->

Execution halted

--------------------------------------------------------------------------

mpirun has exited due to process rank 0 with PID 1077 on

node compute-0-11.local exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in

the job did. This can cause a job to hang indefinitely while it waits

- Read more about Rmpi
- 6 comments
- Log in or register to post comments

## Standard Errors versus Confidence Intervals

If I treat the ordinal data as if it were quantitative, I have no trouble fitting a common factor model.

- Read more about Standard Errors versus Confidence Intervals
- 6 comments
- Log in or register to post comments

## How to use "mxFitFunctionAlgebra" instead of "mxAlgebraObjective"

###############

models_1_v4 <- mxModel("Models_1",

Model_1_t1_v4,

Model_1_t2_v4,

mxAlgebra(

Model_1_t1_v4.objective+

Model_1_t2_v4.objective,

name="multi"),

# mxAlgebraObjective("multi"),

mxFitFunctionAlgebra(algebra = "multi")

)

m1_fit_v4 <- mxRun(models_1_v4)

##################

## Output from mxFactorScores - Order of rows?

The rows are in the order of the _sorted_ data.

I'm not sure what this means. The data I have is in order by date and it's clear that the estimated factor scores for "ML" are no longer in the same order. There are two correlated factors each with 2 indicators (and nothing else). How can I get the factor scores into the same order as the rest of the data?

- Read more about Output from mxFactorScores - Order of rows?
- 5 comments
- Log in or register to post comments

## Handling Exogenous Latent Variables in OpenMx

- Read more about Handling Exogenous Latent Variables in OpenMx
- 1 comment
- Log in or register to post comments

#### Pagination

- Previous page
- Page 7
- Next page