budyko_fit | R Documentation |
Fit Budyko Curve to Data
budyko_fit(
data,
method,
dif = "nls",
res = NULL,
hshift = FALSE,
hs = NULL,
silent = FALSE
)
data |
list dataframe requiring the following two columns: "PET.P" for potential evapotranspiration divided by precipitation (units normalized, dimensionless), and "AET.P" for actual evapotranspiration divided by precipitation or one minus the runoff coefficient (Q/P) |
method |
A string. One of the following: Fu, Turc-Pike, Wang-Tang |
dif |
A string. One of the following: "nls" (default) "rsq" "mae". Determines whether to fit automatically with stats::nls, or manually, with best fit determined by either Pearson's R squared or Minimum Mean Absolute Error |
res |
numeric resolution of fit, defaults to 0.01 units |
hshift |
A boolean. T/F (default F), whether to test for horizontal shift |
hs |
numeric optional horizontal shift value |
silent |
A boolean. (default F) display messages? |
Given a dataset of Aridity Index and Evaporative Index, find the best-fit Budyko Curve. Returns a "fit" object dataframe.
library(ggplot2)
fit=budyko_fit(data=testdata,method="Fu")
blankBC+
geom_line(data=budyko_sim(fit=fit))+
geom_point(data=testdata)+
coord_cartesian(xlim=c(0,5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.