budyko_fit: Fit Budyko Curve to Data

View source: R/functions.R

budyko_fitR Documentation

Fit Budyko Curve to Data

Description

Fit Budyko Curve to Data

Usage

budyko_fit(
  data,
  method,
  dif = "nls",
  res = NULL,
  hshift = FALSE,
  hs = NULL,
  silent = FALSE
)

Arguments

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?

Value

Given a dataset of Aridity Index and Evaporative Index, find the best-fit Budyko Curve. Returns a "fit" object dataframe.

Examples

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))

tylerbhampton/budykoR documentation built on April 21, 2024, 4:39 a.m.