我正在使用EnvStats包,更具体地说,使用simulateVector函数从pdf中生成随机样本。
我尝试使用普通pdf并更改截断此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令我惊讶的是,结果并没有变化.怎么了?谢谢
发布于 2014-08-31 23:30:19
left.tail.cutoff和right.tail.cutoff参数只有在使用sample.method = "LHS"进行拉丁超立方体采样时才有关联。
对于简单的随机抽样,默认的是sample.method = "SRS",它使用rnomr()函数。帮助文件声明“如果sample.method="SRS",则忽略此参数”。
有关默认参数,请参见?simulateVector()。
https://stackoverflow.com/questions/25597007
复制相似问题