Skip to content
Snippets Groups Projects
Commit 3a4ec491 authored by Mauricio Zambrano-Bigiarini's avatar Mauricio Zambrano-Bigiarini
Browse files

'plot_NparOF.R: changed defaults for 'GoFcuts' argument

parent 2f4a634c
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ plot_NparOF <- function(params, ...@@ -68,7 +68,7 @@ plot_NparOF <- function(params,
# Checking 'param.names' # Checking 'param.names'
for ( i in 1:npar) { for ( i in 1:npar) {
if ( !(param.names[i] %in% colnames(params)) ) if ( !(param.names[i] %in% colnames(params)) )
stop("Invalid argument: The field '", param.names[i], "' doesn't exist in 'params'") stop("Invalid argument: The field '", param.names[i], "' does not exist in 'params'")
par.pos[i] <- which(colnames(params) == param.names[i]) par.pos[i] <- which(colnames(params) == param.names[i])
} # FOR end } # FOR end
...@@ -98,11 +98,18 @@ plot_NparOF <- function(params, ...@@ -98,11 +98,18 @@ plot_NparOF <- function(params,
if (verbose) message( "[ Number of behavioural parameter sets: ", nbeh, " ]" ) if (verbose) message( "[ Number of behavioural parameter sets: ", nbeh, " ]" )
} # IF end } # IF end
# If the user didn't provide 'GOFcuts', the 5 quantiles are used # If the user didn't provide 'GOFcuts', the 5 quantiles are used
if (length(GOFcuts) == 1){ if (length(GOFcuts) == 1){
if (GOFcuts=="auto") if (GOFcuts=="auto") {
GOFcuts <- unique( quantile( as.numeric(gofs), ifelse(MinMax=="min",
probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1), na.rm=TRUE) ) GOFcuts <- unique( quantile( as.numeric(gofs),
#probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1), na.rm=TRUE) ),
probs=c(0, 0.5, 0.95, 0.97, 0.98, 0.99, 1), na.rm=TRUE) ),
GOFcuts <- unique( quantile( as.numeric(gofs),
probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1), na.rm=TRUE) ),
} # IF end
} # IF end } # IF end
############################################################################## ##############################################################################
......
...@@ -242,9 +242,9 @@ setwd("~") ...@@ -242,9 +242,9 @@ setwd("~")
# Setting the seed # Setting the seed
set.seed(100) set.seed(100)
# Runing PSO with the 'sphere' test function, writting the results to text files # Runing PSO with the 'sphere' test function, writing the results to text files
hydroPSO( hydroPSO(
fn= "sphere", lower=rep(-100, nparam), upper=rep(100, nparam), fn= sphere, lower=rep(-100, nparam), upper=rep(100, nparam),
control=list(npart=2*nparam, maxit=100, write2disk=TRUE, plot=TRUE) control=list(npart=2*nparam, maxit=100, write2disk=TRUE, plot=TRUE)
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment