boundary conditions
Posted on

(1) am trying to write R code to deal with boundary conditions. is there a SIMPLE way in which i can create an R object from a fitted MxModel that generates vectors of lower and upper bounds for the free parameters? ( i have code that does it, but it is pretty ugly).
(2) the documentation for MxBounds and mxBounds speak of a 'spec' matrix. the same term also appears in several documents when i do a search. anybody tell me what that is? suggest that you include an example of using a 'spec' matrix in the documentation for mxBounds.
greg
Looks like the mxBounds()
I want to confirm that I understand your request. Given a model, traverse through the model and return all the lower bound and upper bound specifications for the free parameters? I can show you some simpler ways to generate this.
Log in or register to post comments
In reply to Looks like the mxBounds() by mspiegel
thanks, mike my goal = create
my goal = create an R object from summary(myMxModel)$parameters that include the lower and upper bounds.
i currently "transverse" through the model, e.g.,
x <- which(myMxModel@matrices[[i]]@free)
theseLBounds <- append(theseLBounds, myMxMatrices@matrices[[i]]@lbound)
but then do beaucoup checking to make certain that the elements in theseLBounds agree with the final parameter estimates in summary(myMxModel)$parameters$Estimate. the problem occurs with parameters with the same label. e.g., if 5 x 5 diagonal matrix has the same label for each of the parameters, then x <- which(myMxModel@matrices[[i]]@free) gives 5 elements that correspond to one row in summary(myMxModel)$parameters. it is this checking that i want to avoid. it is a real bear to see if the code is working correctly.
anyway, OpenMx must have a vector of bounds for the free parameters because the call to NPSOL requires the arguments bl and bu. is there any way to easily access these vectors?
greg
Log in or register to post comments
In reply to thanks, mike my goal = create by carey
Umm, you could access the
I think I will add the lower bound and upper bound to the summary information. But that will not show up until the next OpenMx pre-release and the next major version number.
Log in or register to post comments
mike, muchas, muchas many
muchas, muchas many gracias for doing this. it will eventually be to the user's benefit, but more on that later.
greg
Log in or register to post comments
In reply to mike, muchas, muchas many by carey
In the subversion repository
to determine whether a free parameter is up against a lower boundary
or upper boundary. Use the following:
summ <- summary(modelOut)
lboundMet <- summ$parameters$lboundMet
uboundMet <- summ$parameters$uboundMet
lboundMet is a boolean vector of TRUE/FALSE values if a parameter
estimate is near the lower boundary to within a value of
getOption('mxOptions')[['Feasibility tolerance']]
. Tosee if either the lower or the upper boundary has been reached, use
lboundMet | uboundMet
. When the summary function isprinted, the lower and upper bounds are printed with an asterisk if a
free parameter is up against a boundary.
Log in or register to post comments