[R] Latin hypercube sampling from a non-uniform distribution

Marine Regis marine.regis at hotmail.fr
Wed Aug 9 00:41:48 CEST 2017


Thanks for your answer.

I have attached the plot for representing the variable. I think that I need to draw a Hypercube sample for each age class (i.e., for 0, 1, 2, 3, 4, 5, 6, 7) in a given simulation (i.e., N = 1) and the LHS values for all age classes should be like the observed cumulative distribution (see attached figure). Thus, the output of randomLHS should be a matrix with 100 rows (N = 100 simulations) and 7 columns (7 age classes) containing LHS values and each row should exhibit the same pattern as the observed cumulative distribution.
With the command “qpois(X[, "mortality_probability"], 0.9)”, I don’t obtain a LHS value for each age class and the distribution is not a cumulative distribution as in the attached figure. So, I am afraid I don’t know how to do that.
Thanks so much for your time
Marine



________________________________
De : S Ellison <S.Ellison at LGCGroup.com>
Envoyé : mardi 8 août 2017 14:48
À : Marine Regis; r-help at r-project.org
Objet : RE: Latin hypercube sampling from a non-uniform distribution

> However, my variable is simulated from the cumulative distribution function
> of the Poisson distribution.
Then I am afraid I don't know what you're trying to achieve.
Or why.

However, the principle holds; write a function that maps [0,1] to the 'pattern' you want, do that and apply it to the result from randomLHS.
It happens that for generating data that follow a given probability distribution F, that function is the quantile function for F so you often do not need to write it.






*******************************************************************
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you have received this message in error, please notify the sender
immediately via +44(0)20 8943 7000 or notify postmaster at lgcgroup.com
and delete this message and any copies from your computer and network.
LGC Limited. Registered in England 2991879.
Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rplot.png
Type: image/png
Size: 5579 bytes
Desc: Rplot.png
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20170808/6252fb45/attachment.png>


More information about the R-help mailing list