Modified Kostiakov Infiltration Model
Source:R/self_starting_nls.R, R/self_starting_drc.R
kostmod.RdThese functions provide the Modified Kostiakov Infiltration Model equation (kostmod.fun()), as well as the self-starters for the nls() (SSkostmod()) and drc::drm() functions (DRCkostmod()).
Value
kostmod.fun() and SSkostmod() return a numeric value, while DRCkostmod() returns a list containing the nonlinear function and the self starter function.
Details
The model is defined as:
$$y = \alpha x^{\beta} + f_c$$
where alfa (\(\alpha\)) controls the shape of the curve,
beta (\(\beta\)) is the exponent applied to x and affects
curvature, and fc (\(f_c\)) is the value of the curve at the final
observation (an additive constant).
See also
Other non-linear functions, self-starters:
chaprich.fun(),
exp3.fun(),
expneg.fun(),
expneg2.fun(),
invpoly1.fun(),
invpoly2.fun(),
invpoly3.fun(),
varexp.fun(),
vargauss.fun(),
varsph.fun()
Examples
x <- seq(0.5, 40)
y <- kostmod.fun(x, alfa = 0.3, beta = -0.8, fc = 0.1) + rnorm(40, sd = 0.01)
df <- data.frame(x = x, y = y)
mod = nls(y ~ SSkostmod(x, alfa, beta, fc), data = df)
summary(mod)
#>
#> Formula: y ~ SSkostmod(x, alfa, beta, fc)
#>
#> Parameters:
#> Estimate Std. Error t value Pr(>|t|)
#> alfa 0.307981 0.008137 37.85 <2e-16 ***
#> beta -0.791292 0.030040 -26.34 <2e-16 ***
#> fc 0.096380 0.003942 24.45 <2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.009563 on 37 degrees of freedom
#>
#> Number of iterations to convergence: 4
#> Achieved convergence tolerance: 4.869e-07
#>
plot(x, y, cex = 0.8)
lines(x, predict(mod), col = 'blue')
if (FALSE) { # \dontrun{
mod = drc::drm(y ~ x, data = df, fct = DRCkostmod())
summary(mod)
plot(mod, log = "")
} # }