Learn R Programming

VGAM (version 0.9-3)

nakagami: Nakagami Distribution Family Function

Description

Estimation of the two parameters of the Nakagami distribution by maximum likelihood estimation.

Usage

nakagami(lshape = "loge", lscale = "loge", ishape = NULL, iscale = 1)

Arguments

lshape, lscale
Parameter link functions applied to the shape and scale parameters. Log links ensure they are positive. See Links for more choices and information.
ishape, iscale
Optional initial values for the shape and scale parameters. For ishape, a NULL value means it is obtained in the initialize slot based on the value of iscale. For iscale, assigning a <

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Details

The Nakagami distribution, which is useful for modelling wireless systems such as radio links, can be written $$f(y) = 2 (shape/scale)^{shape} y^{2 \times shape-1} \exp(-shape \times y^2/scale) / \Gamma(shape)$$ for $y > 0$, $shape > 0$, $scale > 0$. The mean of $Y$ is $\sqrt{scale/shape} \times \Gamma(shape+0.5) / \Gamma(shape)$ and these are returned as the fitted values. By default, the linear/additive predictors are $\eta_1=\log(shape)$ and $\eta_2=\log(scale)$. Fisher scoring is implemented.

References

Nakagami, M. (1960) The m-distribution: a general formula of intensity distribution of rapid fading, pp.3--36 in: Statistical Methods in Radio Wave Propagation. W. C. Hoffman, Ed., New York: Pergamon.

See Also

rnaka, gamma2, rayleigh.

Examples

Run this code
nn <- 1000; shape <- exp(0); Scale <- exp(1)
ndata <- data.frame(y1 = sqrt(rgamma(nn, shape = shape, scale = Scale/shape)))
fit <- vglm(y1 ~ 1, nakagami, ndata, trace = TRUE, crit = "coef")
ndata <- transform(ndata, y2 = rnaka(nn, shape = shape, scale = Scale))
fit <- vglm(y2 ~ 1, nakagami(iscale = 3), ndata, trace = TRUE)
head(fitted(fit))
with(ndata, mean(y2))
coef(fit, matrix = TRUE)
(Cfit <- Coef(fit))
with(ndata,
hist(sy <- sort(y2), prob = TRUE, main = "", xlab = "y", ylim = c(0, 0.6)))
lines(dnaka(sy, shape = Cfit[1], scale = Cfit[2]) ~ sy, ndata, col = "orange")

Run the code above in your browser using DataLab