dtplnorm | R Documentation |
Density, cumulative distribution, quantile functions and random number generation for the 3 parameter log normal distribution with the location parameter mu, scale sigma (which corresponds to standard deviation in normal distribution) and shifting parameter shift.
dtplnorm(q, mu = 0, sigma = 1, shift = 0, log = FALSE)
ptplnorm(q, mu = 0, sigma = 1, shift = 0)
qtplnorm(p, mu = 0, sigma = 1, shift = 0)
rtplnorm(n = 1, mu = 0, sigma = 1, shift = 0)
q |
vector of quantiles. |
mu |
vector of location parameters (means). |
sigma |
vector of scale parameters. |
shift |
vector of shift parameters. |
log |
if |
p |
vector of probabilities. |
n |
number of observations. Should be a single number. |
The distribution has the following density function:
f(x) = 1/(x-a) 1/sqrt(2 pi) exp(-(log(x-a)-mu)^2 / (2 sigma^2))
Both ptplnorm
and qtplnorm
are returned for the lower
tail of the distribution.
The function is based on the lnorm functions from stats package, introducing the shift parameter.
Depending on the function, various things are returned (usually either vector or scalar):
dtplnorm
returns the density function value for the
provided parameters.
ptplnorm
returns the value of the cumulative function
for the provided parameters.
qtplnorm
returns quantiles of the distribution. Depending
on what was provided in p
, mu
and sigma
, this
can be either a vector or a matrix, or an array.
rtplnorm
returns a vector of random variables
generated from the tplnorm distribution. Depending on what was
provided in mu
and sigma
, this can be either a vector
or a matrix or an array.
Ivan Svetunkov, ivan@svetunkov.com
Sangal, B. P., & Biswas, A. K. (1970). The 3-Parameter Distribution Applications in Hydrology. Water Resources Research, 6(2), 505–515. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1029/WR006i002p00505")}
Distributions
x <- dtplnorm(c(-1000:1000)/200, 0, 1, 1)
plot(c(-1000:1000)/200, x, type="l")
x <- ptplnorm(c(-1000:1000)/200, 0, 1, 1)
plot(c(-1000:1000)/200, x, type="l")
qtplnorm(c(0.025,0.975), 0, c(1,2), 1)
x <- rtplnorm(1000, 0, 1, 1)
hist(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.