Hello everyone
I am using HydroPSO to calibrate GR4J model and I got this issue in running the code described in the screenshot. I got no result as modelouput although It has been set
Could you tell me what it is not working?
A screenshot is virtually useless here. See See
FAQ Asking Questions
A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here between
```
```
Hello dear,
Thanks for your reply.
Actually, my concern is to know how to fix the error from the created function running .
Here is my code :
modelInputs <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = as.POSIXlt(dates), Precip = P, PotEvap = PET)
runOptions.CAL <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = modelInputs, IndPeriod_WarmUp = WarmUpPeriod.index, IndPeriod_Run = CalPeriod.index)
modeloutput <- RunModel(Param = Param.values, InputsModel = modelInputs, RunOptions = runOptions.CAL, FUN_MOD = RunModel_GR4J)
qsim <- as.numeric(modeloutput$Qsim)
obs <- as.numeric(Obs)
gof <- KGE(sim = qsim, obs = obs, method = "2012")
nelements <- 2
out <- vector("list", nelements)
out[[1]] <- gof
out[[2]] <- qsim
names(out)[1:nelements] <- c("GoF", "sim")
return(out)
}
In this code, all the arguments have been set except Param.values which is the parameters to be optimized by the function GR4Jhydromod.basic we created.
The first thing I noticed is that } has no matching {.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.