1

I'm using the EnvStats package more specifically the simulateVector function to generate random samples from pdf's.

I've tried using a Normal pdf and varying the parameters that truncate this pdf:

> vfy <- simulateVector(10, distribution = "norm",
+                param.list = list(mean = 400, sd = 40), seed = 47,
+                sort = FALSE, left.tail.cutoff = 1, right.tail.cutoff = 1)
> vfy
 [1] 479.7879 428.4457 407.4162 388.7294 404.3510 356.5705 360.5807 400.6052 389.9182 341.3700
> vfy <- simulateVector(10, distribution = "norm",
+                param.list = list(mean = 400, sd = 40), seed = 47,
+                sort = FALSE, left.tail.cutoff = 0, right.tail.cutoff = 0)
> vfy
 [1] 479.7879 428.4457 407.4162 388.7294 404.3510 356.5705 360.5807 400.6052 389.9182 341.3700

For my surprise the results do not vary.... What's wrong? Thanks

www
  • 38,575
  • 12
  • 48
  • 84
jpcgandre
  • 1,487
  • 5
  • 31
  • 55

1 Answers1

2

The left.tail.cutoff and right.tail.cutoff arguments are only relevant when you use sample.method = "LHS" for Latin Hypercube sampling.

The default is sample.method = "SRS" for simple random sampling, which uses the rnomr() function. The help file states "This argument is ignored if sample.method="SRS"."

See ?simulateVector() for the default arguments.

LJW
  • 795
  • 2
  • 13
  • 27
  • Thanks! I thought LHS was the default sampling method. By the way do you know how can one specify lower and upper limit values instead of percentages? Thanks – jpcgandre Aug 31 '14 at 23:37
  • No, sorry. I don't think you can specify lower and upper limit values directly. You might have to calculate the expected probability of the values based on the distribution you're using. – LJW Sep 01 '14 at 05:09