R/rexprayleigh.R

Defines functions rexprayleigh

Documented in rexprayleigh

#' @title Generate random observations from exponentiated Rayleigh distribution
#'
#' @param n number of observations to be generated
#' @param beta scale parameter of the exponentiated Rayleigh distribution
#' @param alpha shape parameter of the exponentiated Rayleigh distribution
#'
#' @return return the random sample generated from exponentiated exponential distribution
#' @export
#' @references Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 21. Wiley, New York.
#'
#' @examples
#' rexprayleigh(100,2,3)

rexprayleigh=function(n,alpha,beta)
{
  p=vector(length =n)
  p=runif(n)
  g=(-beta/(log(1-p^(1/alpha))))^(-1/2)
  return(g)
}

Try the ERPeq package in your browser

Any scripts or data that you put into this service are public.

ERPeq documentation built on July 9, 2023, 5:27 p.m.