
Nutrient Response Curves and Economic Optimum Dose
Source:R/nutrient_functions.R
nutrient_response.RdFits nutrient response models and finds the dose for maximum yield and
the economic optimum dose, where the marginal return equals the price
ratio. Quadratic, linear-plateau, quadratic-plateau and Mitscherlich
models are available; model = "all" fits all four and compares
them.
Usage
nutrient_response(
dose,
yield,
model = "quadratic",
price_output = 50,
price_nutrient = 15,
verbose = TRUE
)Arguments
- dose
Numeric vector of nutrient doses (kg/ha).
- yield
Numeric vector of yields (kg/ha), one per dose (replicated doses are allowed).
- model
"quadratic"(default),"linear_plateau","quadratic_plateau","mitscherlich"or"all".- price_output
Price of the produce (Rs/kg).
- price_nutrient
Price of the nutrient (Rs/kg of nutrient).
- verbose
Logical. If TRUE (default), prints the results.
Value
For a single model, an object of class aridagri_response
with model, coefficients, r_squared,
adj_r_squared, rmse, aic, dose_max_yield,
max_yield, dose_economic, yield_economic and
fit. For model = "all", a list with comparison
(one row per model), models and best (lowest AIC).
Details
Quadratic: \(Y = a + bX + cX^2\); maximum at \(-b/(2c)\); economic optimum \((P_n/P_y - b)/(2c)\).
Linear-plateau: \(Y = a + b \min(X, X_0)\); economic optimum at the join point \(X_0\) when \(b > P_n/P_y\).
Quadratic-plateau: quadratic up to its vertex \(X_0\), then flat.
Mitscherlich: \(Y = A - B e^{-cX}\); economic optimum \(\ln(B c P_y / P_n)/c\); also the dose giving 95% of the asymptote.
Plateau models are fitted by profile least squares over the join
point; the Mitscherlich model by nls with a self-starting model.
All four models have three parameters (the join point counts as one), so
they are compared by R-squared, adjusted R-squared, RMSE and AIC on an
equal footing (AIC differences equal those of stats::AIC()). An
optimum beyond the highest dose tested is flagged as an extrapolation.
References
Cerrato, M.E. and Blackmer, A.M. (1990). Comparison of models for describing corn yield response to nitrogen fertilizer. Agronomy Journal, 82(1), 138-143. doi:10.2134/agronj1990.00021962008200010030x
Examples
dose <- c(0, 20, 40, 60, 80, 100)
yield <- c(1100, 1350, 1520, 1610, 1650, 1660)
nutrient_response(dose, yield, model = "quadratic",
price_output = 60, price_nutrient = 15)
#>
#> ======================================================================
#> NUTRIENT RESPONSE: QUADRATIC
#> ======================================================================
#> Coefficients: a = 1108.6, b = 13.093, c = -0.076786
#> R-squared = 0.9973 Adjusted R-squared = 0.9954 RMSE = 10.51
#> Dose for maximum yield = 85.3 kg/ha (yield 1667)
#> Economic optimum dose = 83.6 kg/ha (yield 1666; price ratio 0.250)
nutrient_response(dose, yield, model = "all", price_output = 60,
price_nutrient = 15)
#>
#> ======================================================================
#> NUTRIENT RESPONSE: MODEL COMPARISON
#> ======================================================================
#> Model R2 Adj_R2 RMSE AIC Dose_max Max_yield Dose_economic
#> quadratic 0.997 0.995 10.511 36.229 85.256 1666.693 83.628
#> linear_plateau 0.990 0.983 20.276 44.113 50.159 1640.000 50.159
#> quadratic_plateau 0.999 0.999 5.750 28.990 79.580 1652.843 78.139
#> mitscherlich 0.998 0.996 9.519 35.040 NA 1704.850 146.460
#> Yield_economic
#> 1666.489
#> 1640.000
#> 1652.663
#> 1696.258
#>
#> Best model by AIC: quadratic_plateau