R: Class "Lnorm"

Lnorm-class {distr} | R Documentation

## Class "Lnorm"

### Description

The log normal distribution has density

d(x) = 1/(sqrt(2 pi) sigma x) e^-((log x - mu)^2 / (2 sigma^2))

where μ, by default =0, and σ, by default =1, are the mean and standard deviation of the logarithm. C.f. `rlnorm`

### Objects from the Class

Objects can be created by calls of the form `Lnorm(meanlog, sdlog)`. This object is a log normal distribution.

### Slots

`img`

  Object of class `"Reals"`: The space of the image of this distribution has got dimension 1 and the name "Real Space".

`param`

  Object of class `"LnormParameter"`: the parameter of this distribution (meanlog and sdlog), declared at its instantiation

`r`

  Object of class `"function"`: generates random numbers (calls function `rlnorm`)

`d`

  Object of class `"function"`: density function (calls function `dlnorm`)

`p`

  Object of class `"function"`: cumulative function (calls function `plnorm`)

`q`

  Object of class `"function"`: inverse of the cumulative function (calls function `qlnorm`)

`.withArith`

  logical: used internally to issue warnings as to interpretation of arithmetics

`.withSim`

  logical: used internally to issue warnings as to accuracy

`.logExact`

  logical: used internally to flag the case where there are explicit formulae for the log version of density, cdf, and quantile function

`.lowerExact`

  logical: used internally to flag the case where there are explicit formulae for the lower tail version of cdf and quantile function

`Symmetry`

  object of class `"DistributionSymmetry"`; used internally to avoid unnecessary calculations.

### Extends

Class `"AbscontDistribution"`, directly.
Class `"UnivariateDistribution"`, by class `"AbscontDistribution"`.
Class `"Distribution"`, by class `"AbscontDistribution"`.

### Methods

initialize

  `signature(.Object = "Lnorm")`: initialize method

meanlog

  `signature(object = "Lnorm")`: returns the slot `meanlog` of the parameter of the distribution

meanlog<-

  `signature(object = "Lnorm")`: modifies the slot `meanlog` of the parameter of the distribution

sdlog

  `signature(object = "Lnorm")`: returns the slot `sdlog` of the parameter of the distribution

sdlog<-

  `signature(object = "Lnorm")`: modifies the slot `sdlog` of the parameter of the distribution

*

  `signature(e1 = "Lnorm", e2 = "numeric")`: For the Lognormal distribution we use its closedness under positive scaling transformations.

### Note

The mean is E(X) = exp(μ + 1/2 σ^2), and the variance Var(X) = exp(2*mu + sigma^2)*(exp(sigma^2) - 1) and hence the coefficient of variation is sqrt(exp(sigma^2) - 1) which is approximately σ when that is small (e.g., σ < 1/2).

### Author(s)

Thomas Stabla statho3@web.de,
Florian Camphausen fcampi@gmx.de,
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de,
Matthias Kohl Matthias.Kohl@stamats.de

### See Also

`LnormParameter-class` `AbscontDistribution-class` `Reals-class` `rlnorm`

### Examples

    L <- Lnorm(meanlog=1,sdlog=1) # L is a lnorm distribution with mean=1 and sd=1.
    r(L)(1) # one random number generated from this distribution, e.g. 3.608011
    d(L)(1) # Density of this distribution is 0.2419707 for x=1.
    p(L)(1) # Probability that x<1 is 0.1586553.
    q(L)(.1) # Probability that x<0.754612 is 0.1.
    ## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.)
    meanlog(L) # meanlog of this distribution is 1.
    meanlog(L) <- 2 # meanlog of this distribution is now 2.

[Package distr version 2.8.0 Index]