[R] lmomco package - Random number generation using Wakeby distribution
David Winsemius
dwinsemius at comcast.net
Tue Jan 22 04:35:42 CET 2013
On Jan 21, 2013, at 6:39 PM, David Winsemius wrote:
>
> On Jan 21, 2013, at 6:15 PM, Katherine Gobin wrote:
>
>> Dear Sir,
>>
>> Thanks a lot for your eye-opener reply. I was just thinking of our usual commands like rnorm, runif etc. So I was wondering if there exists something like rwakeby etc.
>>
>> And lastly, I have calculated the parameters using
>>
>>> lmr = lmom.ub(amounts)
>>> parameters_of_Wakeby = parwak(lmr)
>>
>> whereas you have mentioned lmom2par(), Will it create different set of parameters? Actually I am travelling and don't have R installed on the laptop I am carrying with me to verify ther results.
>
> Neither this posting nor the first one had any data. I'm basically quoting the help files and making what I thought were sensible suggestions that were untested in the absence of data (and in this case in the absence of even code). I have no experience working with this package or with the Wakeby distribution.
I tested with the example offered on ?parwak :
> lmr <- lmomco::lmom.ub(rnorm(20))
> par.wakeby <- lmomco::parwak(lmr)
> lmomco::rlmomco(10, par.wakeby)
[1] 2.74458443 0.12585363 0.09981644 -0.72773835 0.67986712 0.02803862
[7] 0.16152205 -0.62631478 -0.56486845 0.34771307
>
> --
> David.
>
>>
>> Regards
>>
>> Katherine
>>
>>
>>
>> --- On Mon, 21/1/13, David Winsemius <dwinsemius at comcast.net> wrote:
>>
>> From: David Winsemius <dwinsemius at comcast.net>
>> Subject: Re: [R] lmomco package - Random number generation using Wakeby distribution
>> To: "Katherine Gobin" <katherine_gobin at yahoo.com>
>> Cc: r-help at r-project.org
>> Date: Monday, 21 January, 2013, 7:46 PM
>>
>>
>> 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
>>
>
>
> David Winsemius
> Alameda, CA, USA
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius
Alameda, CA, USA
More information about the R-help
mailing list