Description Usage Arguments Author(s) See Also Examples
This function reads/plots the parameter values of each particle and the objective function against the iteration number
1 2 3 4 5 6 7 8 9 10 11 12 | read_GofPerParticle(file="Particles_GofPerIter.txt", na.strings="NA",
plot=TRUE, ptype="one", nrows="auto", main=NULL,
xlab="Number of Iterations", cex=0.4, cex.main=1.5, cex.axis=1.7,
cex.lab=1.5, col, lty=3, ylim, verbose=TRUE, do.png=FALSE,
png.width=1500, png.height=900, png.res=90,
png.fname="Particles_GofPerIter.png")
plot_GofPerParticle(x, ptype="one", nrows="auto", main=NULL,
xlab="Number of Iterations", cex=0.4, cex.main=1.5, cex.axis=1.7,
cex.lab=1.5, col=rainbow(ncol(x)), lty=3, ylim=NULL, verbose=TRUE, ...,
do.png=FALSE, png.width=1500, png.height=900, png.res=90,
png.fname="Particles_GofPerIter.png")
|
file |
character, name (including path) of the file to be read |
na.strings |
character vector, strings which are to be interpreted as |
plot |
logical, indicates if a plot with the convergence measures has to be produced |
x |
data.frame with the goodness-of-fit measure of each particle per iteration. |
ptype |
character, representing the type of plot. Valid values are: in c("one", "many"), for plotting all the particles in the smae figure or in one windows per particle, respectively |
nrows |
OPTIONAL. Only used when |
main |
OPTIONAL. Only used when |
xlab |
OPTIONAL. Only used when |
cex |
OPTIONAL. Only used when |
cex.main |
OPTIONAL. Only used when |
cex.axis |
OPTIONAL. Only used when |
cex.lab |
OPTIONAL. Only used when |
col |
OPTIONAL. Only used when |
lty |
OPTIONAL. Only used when |
ylim |
numeric with the the ‘y’ limits of the plot |
verbose |
logical, if TRUE, progress messages are printed |
... |
OPTIONAL. Only used when |
do.png |
logical, indicates if all the figures have to be saved into PNG files instead of the screen device |
png.width |
OPTIONAL. Only used when |
png.height |
OPTIONAL. Only used when |
png.res |
OPTIONAL. Only used when |
png.fname |
OPTIONAL. Only used when |
Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com
read_results
, plot_results
, plot_2parOF
, plot_NparOF
, plot_ParamsPerIter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# Setting the user home directory as working directory
setwd("~")
# Number of dimensions to be optimised
D <- 4
# 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, write2disk=TRUE, plot=TRUE) )
# Reading the convergence measures got by running hydroPSO
setwd("PSO.out")
read_GofPerParticle() # all the particles in the same window
read_GofPerParticle(ptype="many") # each particle in a different pannel
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.