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

Marine Regis marine.regis at hotmail.fr
Fri Aug 4 18:05:29 CEST 2017


Hello,

I am performing a sensitivity analysis using a Latin Hypercube sampling. However, I have difficulty to draw a Hypercube sample for one variable. I’ve generated this variable from a Poisson distribution as follows:

set.seed(5)
mortality_probability <- round(ppois(seq(0, 7, by = 1), lambda = 0.9), 2)
barplot(mortality_probability, names.arg = seq(0, 7, by = 1), xlab = "Age class", ylab = "Probability")

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

Here is a reproducible code to draw Hypercube samples (my sensitivity analysis includes several parameters and the variables “var1” and “var2” follow a uniform distribution):

library(lhs)
set.seed(1)
parm <- c("var1", "var2", "mortality_probability")
X <- randomLHS(100, length(parm))

Any suggestions would be much welcome.

Thanks for your time
Marine


	[[alternative HTML version deleted]]



More information about the R-help mailing list