mxRestore {OpenMx}R Documentation

Restore From Checkpoint File

Description

The function loads the last saved state from a checkpoint file.

Usage

mxRestore(model, chkpt.directory = ".", chkpt.prefix = "")

Arguments

model MxModel object to be loaded.
chkpt.directory character. Directory where the checkpoint file is located.
chkpt.prefix character. Prefix of the checkpoint file.

Details

In general, the arguments ‘chkpt.directory’ and ‘chkpt.prefix’ should be identical to the mxOption: ‘Checkpoint Directory’ and ‘Checkpoint Prefix’ that were specificed on the model before execution.

Alternatively, the checkpoint file can be manually loaded as a data.frame in R. Use read.table with the options ‘header=TRUE’, ‘stringsAsFactors=FALSE’ and ‘check.names=FALSE’.

Value

Returns an MxModel object with free parameters updated to the last saved values.

References

The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation.

Examples

#Create a model that includes data, 
#matrices A, S and F, and an objective function
## Not run: 
data <- mxData(mydata, type="cov", numObs = 100)
objective <- mxRAMObjective('A', 'S', 'F')
model <- mxModel("mymodel", A, S, F, data, objective)

#Use mxRun to optimize the free parameters in the matrices A and S
modelOut <- mxRun(model, checkpoint = TRUE)

#Use mxRestore to load the last saved state of the model
modelRestore <- mxRestore(model)
## End(Not run)

[Package OpenMx version 1.0.0-1448 Index]