MyNixOS website logo
Description

Functions for the Nakagami Distribution.

Density, distribution function, quantile function and random generation for the Nakagami distribution of Nakagami (1960) <doi:10.1016/B978-0-08-009306-2.50005-4>.

nakagami

R buildstatus Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. CRAN_Status_Badge

Overview

An R-package for the Nakagami distribution.

Installation

Use the following command from inside R:

# install.packages("devtools")
devtools::install_github("JonasMoss/nakagami")

Usage

The density function is dnaka, the probability distribution is pnaka, the quantile function is qnaka and random deviate generator is rnaka. Use them just like the *gamma functions in the stats package.

set.seed(313)
x = seq(0, 3, by = 0.01)
hist(nakagami::rnaka(10^5, shape = 4, scale = 2), freq = FALSE, breaks = "FD")
lines(x, nakagami::dnaka(x, shape = 4, scale = 2), type = "l", lwd = 2)

Note

All of these functions are implemented in the R package VGAM. As of VGAM version 1.1-2, the implementations in nakagami are faster, more thoroughly tested, and use a standardized set of arguments following the template of dgamma et cetera.

The rnaka of nakagami is much faster than the rnaka of VGAM:

#install.packages("VGAM")

microbenchmark::microbenchmark(nakagami::rnaka(100, 2, 4), 
                               VGAM::rnaka(100, 4, 2))
#> Unit: microseconds
#>                        expr    min     lq     mean  median     uq      max
#>  nakagami::rnaka(100, 2, 4)  182.7  219.7 2374.957  302.05  428.3 154306.4
#>      VGAM::rnaka(100, 4, 2) 1319.7 1670.6 9874.742 1901.20 2569.0 772334.0
#>  neval
#>    100
#>    100

And the quantile function of nakagami is slightly faster.

p = 1:10/11
microbenchmark::microbenchmark(nakagami::qnaka(0.01, 10, 4), 
                               VGAM::qnaka(0.01, 4, 10))
#> Unit: microseconds
#>                          expr   min     lq    mean median     uq    max neval
#>  nakagami::qnaka(0.01, 10, 4) 184.1 196.00 317.706 223.05 336.80 2665.5   100
#>      VGAM::qnaka(0.01, 4, 10) 277.5 301.95 482.844 323.00 520.75 2979.1   100

Moreover, VGAM::qnaka fails to implement the standard argument log.p and VGAM::rnaka uses the non-standard arguments Smallno and ....

How to Contribute or Get Help

If you encounter a bug, have a feature request or need some help, open a Github issue.

This project follows a Contributor Code of Conduct.

References

  • Nakagami, N. 1960. “The m-Distribution, a General Formula of Intensity of Rapid Fading.” In Statistical Methods in Radio Wave Propagation: Proceedings of a Symposium Held at the University of California, June 18–20, 1958, edited by William C. Hoffman, 3–36. Permagon Press. https://doi.org/10.1016/B978-0-08-009306-2.50005-4.

  • Yee TW (2010). “The VGAM Package for Categorical Data Analysis.” Journal of Statistical Software, 32(10), 1–34. https://www.jstatsoft.org/v32/i10/.

Metadata

Version

1.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows