You are here

confidence intervals in a common pathway model (with constraint)

2 posts / 0 new
Last post
tbates's picture
Joined: 07/31/2009 - 14:25
confidence intervals in a common pathway model (with constraint)

Reviewers have requested I give confidence intervals on estimates from a common pathway model (I am using the

umx::umxCP<rsplus> function to build my common pathway model).
When I try and use Hunter's nice <rsplus>mxSE(top.es_std[1,1], model = cp3)

function on my model (e.g. to request the SE on the specific-e for variable 1), I get the following error:

    Model does not have a reasonable Hessian or standard errors.
    Model has at least one mxConstraint. This prevented standard error computation.
    Try mxCI()

Is there any work-around for this (to use mxSE with a constraint in the model)?

Computing profile-based CIs will take a considerable time…

Can the CP model be implemented without constraints? the constraint used is

    mxConstraint(diagL == nFac_Unit   , name = "fix_CP_variances_to_1"),

Many thanks!

PS: Why do constraints invalidate SEs?

AdminRobK's picture
Joined: 01/24/2014 - 12:15
Can the CP model be implemented without constraints?

I think so. You could instead just fix the nonshared-environmental variance of the CP to some value (1.0, say). Or, you could fix one of the loadings onto the CP to 1.0, and freely estimate the CP's A, C, and E variances.

Is there any work-around for this (to use mxSE with a constraint in the model)?

PS: Why do constraints invalidate SEs?

As you know, standard errors are calculated as the square roots of the diagonal elements of the inverted Fisher information matrix (which in OpenMx is typically twice the inverted Hessian). The sampling covariance matrix you get from inverting the information matrix simply doesn't reflect the influence of the constraints on the repeated-sampling distribution of the parameter estimates.

You must have missed my recent email to the OpenMx developer list about valid standard errors in the presence of constraints. It turns out it's possible to calculate an asymptotically valid sampling covariance matrix from the usual Hessian, and a matrix providing a basis for the nullspace of the constraint Jacobian matrix. The current plan is to implement this approach in the backend, as part of the MxComputeNumericDeriv and MxComputeStandardError compute steps. Here's a demonstration script:

mxOption(NULL,"Default optimizer","SLSQP")
#Custom compute plan, to calculate Hessian despite constraints:
plan <- omxDefaultComputePlan()
plan$steps <- list(plan$steps$GD, plan$steps$ND, plan$steps$RD, plan$steps$RE)
#MxModel to estimate multinomial proportions from frequencies (something that can be done by hand):
m1 <- mxModel(
    mxAlgebra( -2*(43*log(Pred) + 22*log(Pyellow) + 20*log(Pgreen) + 15*log(Pblue)), name="fitfunc"),
    mxAlgebra( cbind(-2*43/Pred,-2*22/Pyellow,-2*20/Pgreen,-2*15/Pblue), name="objgrad",
    mxConstraint(Pred + Pyellow + Pgreen + Pblue - 1 == 0,name="indentifying")
m1run <- mxRun(m1)
#Estimated proportions:
p <- c(0.43,0.22,0.2,0.15)
#Basis for the nullspace of the constraint Jacobian:
U <- Null(t(m1run$output$constraintJacobian))
#Repeated-sampling covariance matrix:
#Analytic value of covariance matrix, for comparison: