read_out(file="Model_out.txt", modelout.cols=NULL, nsim=NULL, obs, MinMax=NULL,
beh.thr=NA,verbose=TRUE,plot=TRUE,ptype=c("corr","ts","ecdf","quant2ecdf"),
ftype="dm", FUN=mean, weights=NULL, byrow=TRUE,
quantiles.desired= c(0.05,0.5,0.95),
quantiles.labels= c("Q5", "Q50", "Q95"), main=NULL, ylab="Probability",
col="blue", leg.cex=1.2, leg.pos="bottomright",
cex.axis=1.2, cex.main=1.2, cex.lab=1.2, do.png=FALSE, png.width=1500,
png.height=900, png.res=90, png.fname="ModelOut_vs_Obs.png")
plot_out(sim, obs, dates=NULL, ptype=c("corr","ts","ecdf","quant2ecdf"),
MinMax=NULL, ftype="o", FUN=mean, verbose=TRUE, weights=NULL, byrow=TRUE,
quantiles.desired= c(0.05,0.5,0.95), quantiles.labels=c("Q5","Q50","Q95"),
main=NULL, ylab="Probability", col="blue", leg.cex=1.2,
leg.pos="bottomright", cex.axis=1.2, cex.main=1.2, cex.lab=1.2,
do.png=FALSE, png.width=1500, png.height=900, png.res=90,
png.fname="ModelOut_vs_Obs.png")file that store the outputs that have to be read/plotted, without counting the first three that correspond to iteration, particle and goodness-of-fit value. If modelout.cols=NULL, all the columns in NA instead of the simulated values for some parameter set(s) (e.g.,obs is not provided, its values are read from the output sim and obs. If sim and/or obs already have a time stamp, it is over-written by dates
It must have the same c('min', 'max')beh.th, depending on the value of MinMax
It is used for drawing a horizontal line used for sepaplot=TRUE and ptype=="ts".See ggofplot=TRUE and ptype=="ts".See ggofquant2ecdf
Omitting the weights argument or specifying NULL or a zero-length vector will resux. See quant2ecdf
When the simulated equivalents are stored in columns, byrow mustquant2ecdfplot=TRUE
character vector, names to quantiles.desired. Default value is c("Q5", "Q50", "Q95"). See quant2ecdfplot=TRUE
title for the plotplot=TRUE
title for the y axis. See plotplot=TRUE
specification for the default plotting colour. See parplot=TRUE
character expansion factor *relative* to current 'par("cex")'. Used for text, and provides the default for 'pt.cex' and 'title.cex' Default value = 1.2plot=TRUE
keyword to be used to position the legend. See legendplot=TRUE
numeric, magnification to be used for the axis annotation relative to 'cex'. See parplot=TRUE
numeric, representing the magnification to be used for main titles relative to the current setting of cexplot=TRUE
numeric, representing the magnification to be used for x and y labels relative to the current setting of 'cex'. See pardo.png=TRUE
numeric, width of the device. See pngdo.png=TRUE
numeric, height of the device. See pngdo.png=TRUE
numeric, nominal resolution in ppi which will be recorded in the PNG file, if a positive integer of the device. See pngdo.png=TRUE
character, name of the output PNG file. See pngMinMaxobsread_results, plot_results, quant2ecdf# Setting the user home directory as working directory
setwd("~")
# Number of dimensions to be optimised
D <- 5
# Boundaries of the search space (Sphere test function)
lower <- rep(-100, D)
upper <- rep(100, D)
# Setting the seed
set.seed(100)
# Runing PSO with the 'Sphere' test function, writting the results to text files
hydroPSO(fn=sphere, lower=lower, upper=upper,
control=list(maxit=100, topology="gbest", write2disk=TRUE, plot=TRUE)
)
# Reading the convergence measures got by running hydroPSO
setwd("PSO.out")
read_out(MinMax="min") # each particle in a different pannelRun the code above in your browser using DataLab