Last active
August 29, 2015 14:04
-
-
Save cvitolo/15aa013dc72dd9b39130 to your computer and use it in GitHub Desktop.
new FUSE and HYDROMAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install/load dependent libraries | |
if(!require(zoo)) install.packages("zoo") | |
library(zoo) | |
if(!require(tgp)) install.packages("tgp") | |
library(tgp) | |
if(!require(qualV)) install.packages("qualV") | |
library(qualV) | |
if(!require(hydromad)) install.packages("hydromad",repos="http://hydromad.catchment.org") | |
library(hydromad) | |
if(!require(devtools)) install.packages("devtools") | |
library(devtools) | |
# install the fuse package directly from GitHub | |
install_github("ICHydro/r_fuse", subdir = "fuse") | |
library(fuse) | |
# Load sample data | |
data(DATA) | |
# Set the parameter ranges | |
hydromad.options(fusesma=fusesma.ranges(),fuserouting=fuserouting.ranges()) | |
# Set model | |
modspec <- hydromad(DATA, sma = "fusesma", routing = "fuserouting", mid = 1:1248, deltim = 1) | |
# Randomly generate 1 parameter set | |
myNewParameterSet <- parameterSets( coef(modspec, warn=FALSE), 1, method="random") | |
# Run a simulation using the parameter set generated above | |
modx <- update(modspec, newpars = myNewParameterSet) | |
# Generate a summary of the result | |
summary(modx) | |
# Plot results | |
hydromad:::xyplot.hydromad(modx, with.P=TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment