开发者

How can I get the actual vectors generated from bootstrapping using tsboot?

开发者 https://www.devze.com 2023-01-04 22:32 出处:网络
I need to get the actual list of elements used to generate each resampled statistic. To keep things really easy, I generated 100 random numbers and wanted to get the mean of each sample using tsboot f

I need to get the actual list of elements used to generate each resampled statistic. To keep things really easy, I generated 100 random numbers and wanted to get the mean of each sample using tsboot from the boot package.

x <- rnorm(100)
y <- tsboot(x, mean, R=10, l=20, sim="fixed")

What I need is the 10 lists of 20 numbers generated by tsboot. I realize that there is probably an easier way to do this but the act开发者_运维技巧ual project will require substituting a function for the mean and playing around with the block size. I tried using tsbootstrap but also couldn't get the right output. Any assistance would be greatly appreciated.


Try

boot.array(y)

which returns a matrix with R=10 rows containing the (ordered) indices of the selected values.

0

精彩评论

暂无评论...
验证码 换一张
取 消