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

S Ellison
Mon, 07 Aug 2017 12:36:59 -0000

> How can I draw a Hypercube sample for the variable  mortality_probability
so
> that this variable exhibits the same pattern as the observed distribution?

One simple way is to use the uniform random output of randomLHS as input to the
quantile function for your desired distribution(s).

For example:

q <- randomLHS(1000, 3)
colnames(q) <- c("A", "B", "mort")
q[, "mort"] <- qpois(q[,"mort"], 1.5)


S Ellison






*******************************************************************
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