[R] bootstrapping for maxium data

Angelo Canty angelocanty at sympatico.ca
Wed May 21 17:44:49 CEST 2014


Yichun,

1. You are doing this wrong!
2. It is the wrong thing to do!

In more detail:
1. To use boot, it helps to read the help file which clearly says the 
statistic must be a function of two arguments, the original dataset and 
the indices saying which of the original datapoints are in the bootstrap 
dataset (or the frequency of each original datapoint in the bootstrap 
dataset). A valid statistic would be
function(x,i) max(x[i])

2. See Davison and Hinkley example 2.15 which shows that the bootstrap 
is inconsistent for the sample maximum!


On 21/05/2014 1:49 AM, 张以春 wrote:
> Dear friends,
>
>
> I  have a numeric vector composed of 320 numbers.
>
>
> Now, I want to do resample for 10000 times. I want to get maxium number for every trial and get a 10000 maxium numbers.
>
>
> I have tried to use "boot" package such as follows.
>
>
> results<-boot(data=nearshore1,statistic=max,R=10000,stype="w")
>
>
> But, surprising, the results shows that I got 10000 A (A is the maxium number in "nearshore1")
>
>
> It's a puzzle to me. I do not know how to do that. Thank you.
>
>
> Yichun
>
>
>
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
------------------------------------------------------------------
|   Angelo J. Canty                Email: cantya at mcmaster.ca     |
|   Mathematics and Statistics     Phone: (905) 525-9140 x 27079 |
|   McMaster University            Fax  : (905) 522-0935         |
|   1280 Main St. W.                                             |
|   Hamilton ON L8S 4K1                                          |



More information about the R-help mailing list