# NOT RUN {
library(OpenMx)
m1 <- mxModel(
"poly22", # Eqn 22 from Tsallis & Stariolo (1996)
mxMatrix(type='Full', values=runif(4, min=-1e6, max=1e6),
ncol=1, nrow=4, free=TRUE, name='x'),
mxAlgebra(sum((x*x-8)^2) + 5*sum(x) + 57.3276, name="fit"),
mxFitFunctionAlgebra('fit'))
plan <- mxComputeLoop(list(
mxComputeSetOriginalStarts(),
mxComputeSimAnnealing(method="tsallis1996",
control=list(tempEnd=1)),
mxComputeCheckpoint(path = "result.log")),
i=1:4)
m1 <- mxRun(mxModel(m1, plan)) # see the file 'result.log'
# }
Run the code above in your browser using DataLab