Katherine Gobin
2013-Jan-21 18:30 UTC
[R] lmomco package - Random number generation using Wakeby distribution
Dear R forum>From the given data, I have estimated the parameters of Wakeby distribution using lmomco package aslibrary(lmomco) (amounts <- read.csv("input_S.csv")$amount) # ___________________________________________________________ # Wakeby distribution - Parameter estimation N length(amounts) lmr = lmom.ub(amounts) parameters_of_Wakeby = parwak(lmr)> parameters_of_Wakeby$type [1] "wak" $para xi alpha 1.18813927666405e+04 0.00000000000000e+00 beta gamma 0.00000000000000e+00 8.11391042554567e+04 delta 9.57554297149062e-01 This means the scale parameters are 0. However, assuming, all the five parameters of Wakeby distribution (viz. location parameter m (xi), the scale parameters a, b, and shape parameters g and d are available. Then, how do I generate say 100 random no.s using Wakeby distribution w.r.t. these 5 available parameters. I couldn't find any information about this in lmomco. Kindly guide if random no.s can be generated or not and if yes, how it can be done in r. Thanking in advance Katherine [[alternative HTML version deleted]]
David Winsemius
2013-Jan-21 19:46 UTC
[R] lmomco package - Random number generation using Wakeby distribution
On Jan 21, 2013, at 10:30 AM, Katherine Gobin wrote:> Dear R forum > >> From the given data, I have estimated the parameters of Wakeby distribution using lmomco package as > > library(lmomco) > > (amounts <- read.csv("input_S.csv")$amount) > > # ___________________________________________________________ > > # Wakeby distribution - Parameter estimation > > N > length(amounts) > lmr = lmom.ub(amounts) > parameters_of_Wakeby = parwak(lmr)It appears you have a) not included the code that produced that output and b) failed to read the Index page for that package help(package="lmomco") help(package="lmomco") ?rlmomco # Random Deviates of a Distribution So on the assumption that you have an object in your workspace named "parameters_of_Wakeby" and it is an lmomco produced object like that returned by lmom2par() I would try: rlmomco(100, parameters_of_Wakeby)> >> parameters_of_Wakeby > > $type > [1] > "wak" > > $para > xi alpha > 1.18813927666405e+04 0.00000000000000e+00 > beta gamma > 0.00000000000000e+00 8.11391042554567e+04 > delta > 9.57554297149062e-01 > > This means the scale parameters are 0. > > However, assuming, all the five parameters of Wakeby distribution (viz. location parameter m (xi), the scale parameters a, b, and shape parameters g and d are available. > > Then, how do I generate say 100 random no.s using Wakeby distribution w.r.t. these > 5 available parameters. > > I couldn't find any information about this in lmomco. Kindly guide if random no.s can be generated or not and if yes, how it can be done in r.You should have been able to find this with: help.search("random", package="lmomco") -- David Winsemius Alameda, CA, USA