search for: rkappa

Displaying 1 result from an estimated 1 matches for "rkappa".

Did you mean: kappa
2008 Jun 04
1
Minimizing the negative log likelihood function...
Hey, The following is a function I wrote which generates random variables from a Kappa (2-parameter) distribution. rkappa <- function(n,beta,alpha){ if(alpha <= 0) stop("alpha must be greater than zero!") if(beta <= 0) stop("beta must be greater than zero!") Vec <- beta*exp((1/alpha)*(log(-(alpha/(-1 + exp(alpha*log(runif(n,0,1))))))+ alpha*log(runif(n,0,1)))) return(Vec) } Now...