dLSW: The Lifshitz-Slyozov-Wagner distribution

View source: R/lsw_sews.R

dLSWR Documentation

The Lifshitz-Slyozov-Wagner distribution

Description

Density and distribution function for the Lifshitz-Slyozov-Wagner (LSW) distribution with mean mu.

Usage

dLSW(x, mu, log = FALSE)

pLSW(x, mu, lower.tail = TRUE, log.p = FALSE)

LSW_fit(x)

Arguments

x

vector of quantiles

mu

the mean of the distribution

log, log.p

logical; if TRUE, probabilities p are given as log(p)

lower.tail

logical; if TRUE (default), probabilities are P[X \le x] otherwise, P[X > x]

Details

The LSW distribution is a continuous distribution with density

f(x) = \frac{4x^2}{9\mu^3} ( \frac{3\mu}{3\mu + x} )^{7/3} ( \frac{3\mu}{3\mu - 2x} )^{11/3} e^{\frac{2x}{2x - 3\mu}}

where \mu is the mean of the distribution.

The functions dLSW gives the probability density, pLSW gives the distribution function. qLSW and rLSW are not implemented. You can use LSW_fit to fit an LSW distribution to a set of observations.

The length of the results is determined by the length of x, and mu can only be a single value.

Please note that this distribution has support only on the interval [0,mu*3/2). Probabilities outside this interval are returned as 0.

Value

dLSW gives the density, pLSW gives the distribution function, both as numerical vectors determined by the length of x.

References

Siteur, Koen, Quan-Xing Liu, Vivi Rottschäfer, Tjisse van der Heide, Max Rietkerk, Arjen Doelman, Christoffer Boström, and Johan van de Koppel. 2023. "Phase-Separation Physics Underlies New Theory for the Resilience of Patchy Ecosystems." Proceedings of the National Academy of Sciences 120 (2): e2202683120. https://doi.org/10.1073/pnas.2202683120.

See Also

lsw_sews

Examples


# Plot the density 
x <- seq(0, 10, l = 128) 
plot(x, dLSW(x, mu = 3), type = "l", col = "black")
lines(x, dLSW(x, mu = 5), type = "l", col = "red")
lines(x, dLSW(x, mu = 7), type = "l", col = "blue")
legend(x = 0, y = max(dLSW(x, mu = 3)), lty = 1, col = c("black", "red", "blue"), 
       legend = paste("mu =", c(3, 5, 7)))


spatialwarnings documentation built on Sept. 11, 2024, 8:55 p.m.