美文网首页
Bootstrapping test

Bootstrapping test

作者: Strewn | 来源:发表于2020-05-08 11:03 被阅读0次

    Bootstrapping is a statistical method that uses data resampling with replacement (see: generate_sample_indices) to estimate the robust properties of nearly any statistic. Most commonly, these include standard errors and confidence intervals of a population parameter like a mean, median, correlation coefficient or regression coefficient. Bootstrapping statistics has two attractive attributes:

    It is particularly useful when dealing with small sample sizes; It makes no apriori assumption about the distribution of the sample data.

    The first rule of data processing is look at your data; the second rule of data processing is understand your data

    使用Bootstaping test方法检验两个相关系数是否具有显著性差异

    nBoot = 1000 ; user set 

    nDim = 0 ; or (/0,0/); dimension numbers corresponding to 'N' 

    opt = False ; use all default options 

    BootStrap =bootstrap_correl(x, y, nBoot, nDim, opt) 

    rBoot = BootStrap[0]; bootstrapped cross-correlations inascendingorder 

    rBootAvg = BootStrap[1]; Average of the z-transformed bootstrapped cross correlations 

    rBootStd = BootStrap[2]; Std. deviation(s) of the z-transformed bootstrapped cross correlations

    delete(BootStrap) ; no longer needed 

    rBootLow =bootstrap_estimate(rBoot, 0.025, False) ; 2.5% lower confidence bound 

    rBootMed =bootstrap_estimate(rBoot, 0.500, False) ; 50.0% median of bootstrapped estimates

    绘制直方图:

    resr = True

    resr@gsnDraw    = False

    resr@gsnFrame    = False

    resr@gsnHistogramNumberOfBins = 25

    resr@tmXBLabelStride = 4

    resr@gsFillColor    = "red"

    rBoot@long_name  = "Bootstrapped cross-correlations"

    hstr    = gsn_histogram(wks, rBoot  ,resr) 

    https://www.ncl.ucar.edu/Applications/Scripts/bootstrap_correl_1.ncl

    使用Bootstaping test方法检验两个均方根误差是否具有显著性差异

    nBoot = 10000 

    xBoot =new(nBoot, typeof(x)) 

    do ns=0,nBoot-1 ; generate multiple estimates 

        iw =generate_sample_indices(N,1) ; indices with replacement 

        xBoot(ns) =dim_avg_n( x(iw), 0 ) ; compute average 

    end do 

    xAvgBoot =dim_avg_n(xBoot,0) ; Averages of bootstrapped samples 

    xStdBoot =dim_stddev_n(xBoot,0) ; Std Dev " " " 

    xStdErrBoot = xStdBoot/nBoot ; Std. Error of bootstrapped estimates 

    ia =dim_pqsort_n(xBoot, 2, 0) ; sort bootstrap means into ascending order 

    n025 =round(0.025*(nBoot-1),3) ; indices for sorted array 

    n500 =round(0.500*(nBoot-1),3) 

    n975 =round(0.975*(nBoot-1),3) 

    xBoot_025= xBoot(n025) ; 2.5% level 

    xBoot_500= xBoot(n500) ; 50.0% level (median) 

    xBoot_975= xBoot(n975) ; 97.5% level

    结合上面绘制直方图。

    参考:

    https://www.ncl.ucar.edu/Applications/bootstrap.shtml

    Statistical methods for the analysis of simulated and observed climate data Barbara Hennemuth et al (2013) Applied in projects and institutions dealing with climate change impact and adaptationCSC Report 13 (一本比较好的气候数据统计书)

    相关文章

      网友评论

          本文标题:Bootstrapping test

          本文链接:https://www.haomeiwen.com/subject/ydvxnhtx.html