You are here

?mxAlgebra example code doesn't run

Documentation helper gives an error
Running AlgebraExample
Error in mxRun(modelD) :
MxAlgebraObjective's objective algebra does not evaluate to a 1x1 matrix.

I'd suggest this:

A <- mxMatrix("Full", nrow = 3, ncol = 3, values=2, name = "A")

Simple example: algebra B simply evaluates to the matrix A

B <- mxAlgebra(A, name = "B")

Compute A + B

C <- mxAlgebra(A + B, name = "C")

Compute sin(C)

D <- mxAlgebra(sin(C), name = "D")

Make a model and evaluate the mxAlgebra object 'D'

A <- mxMatrix("Full", nrow = 3, ncol = 3, values=2, name = "A")
model <- mxModel("AlgebraExample", A, B, C, D )
fit <- mxRun(model)
mxEval(D, fit)

Reporter: 
Created: 
Sun, 09/06/2009 - 22:18
Updated: 
Mon, 09/28/2009 - 22:36

Comments

bump

Fixed in r820.

Thanks Michael,

I didn't know where these lived, or the format: so nice to see it is easy to find and edit.

trunk/man/mxAlgebra.Rd