Learn R Programming

R2GUESS (version 2.0)

Resume.R2GUESS: Function resuming an interrupted R2GUESS run

Description

The Resume.R2GUESS function will resume a run that was interrupted due to computation time exceeding the user-defined time limit.

Usage

Resume.R2GUESS(x, time.limit=NULL)

Arguments

x

an ESS object corresponding to a preliminary R2GUESS run which was interrupted due to computing time exceeding the user-specified time limit.

time.limit

a numerical value specifying the maximum computing time (in hours) for the continuation of the run. If the run exceeds that value, modelling options, parameters value, state of the pseudo random number generator, and state of each chain will be saved to enable to resume the run exactly at the same point it was interrupted (using resume option). By default (=NULL) the resuming run will go on until its completion.

Value

If the resuming run completes the run, it will return the complete ESS object (compiling information listed in as.ESS.object function).

Details

The Resume.R2GUESS function will continue a run that was interrupted due to computation time exceeding the user-defined time limit. It will compile data, input files and parameters that are required for running GUESS code. Additional iterations required to complete the run will be appended to the existing history files, and posterior calculations (MPPI, MPP, and the list of best models) will be added to the ESS object. The function will use the same pseudo-random number generator as the one used for the initial run, and will initialise it at the state it was at the end of the original run.

See Also

Extend.R2GUESS, Postprocess.R2GUESS, as.ESS.object

Examples

Run this code
# NOT RUN {
## First we are creating a run which has been not finished in 1 hour
path.input <- system.file("Input", package="R2GUESS")
path.output <- tempdir()
path.par <- system.file("extdata", package="R2GUESS")
file.par.Hopx <- "Par_file_example_Hopx.xml"
print(paste(path.par,file.par.Hopx,sep=""))
root.file.output.Hopx <- "Example-GUESS-Y-Hopx"
label.Y <- c("ADR","Fat","Heart","Kidney")
data(data.Y.Hopx)
data(data.X)
data(MAP.file)

modelY_Hopx<-R2GUESS(dataY=data.Y.Hopx,dataX=data.X,choice.Y=1:4,
label.Y=label.Y,,MAP.file=MAP.file,file.par=file.par.Hopx,
file.init=NULL,file.log=NULL,root.file.output=root.file.output.Hopx,
path.input=path.input,path.output=path.output,path.par=path.par
,path.init=NULL,nsweep=510000,burn.in=10000,Egam=5,Sgam=5,top=100
,history=TRUE,time=TRUE,nb.chain=3,conf=0,cuda=FALSE,time.limit=1)

modelY_Hopx_resume <- Resume.R2GUESS(modelY_Hopx)

# }

Run the code above in your browser using DataLab