[ncl-talk] generate indices for resampling

Andrew Kren - NOAA Affiliate andrew.kren at noaa.gov
Fri Jun 1 12:40:27 MDT 2018


That works, I didn't think of that. Thanks Dennis.

On Fri, Jun 1, 2018 at 12:38 PM, Dennis Shea <shea at ucar.edu> wrote:

>
> Not sure I understand
>
> http://www.ncl.ucar.edu/Applications/bootstrap.shtml
>
> http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_
> indices.shtml
>
> ====
> ntim = dimsizes(time)
> iwo = generate_sample_indices(ntim,0)   ; *entire* period
>
> ntim80 = toint(0.80*ntim)
> iwo80  = iwo(0:ntim80-1)  ; extract the 1st 80% of the indices
>
> ====
>
>
>
>
> On Fri, Jun 1, 2018 at 10:06 AM, Andrew Kren - NOAA Affiliate <
> andrew.kren at noaa.gov> wrote:
>
>> Dear ncl-talk,
>>
>> This is more of a science question than a coding issue. I noticed ncl has
>> the function generate_sample_indices to resample with and without
>> replacement. My data is temperature and moisture retrievals as function of
>> (time,lev). The issue I am tackling is that my data has a high temporal
>> frequency. I want to thin the data prior to assimilating it in the HWRF.
>> The data is reported at approximately every 2-3 seconds for a full 24
>> hours. So I have a lot of measurements and want to thin it.
>>
>> I did a test where I retain 80% of the data randomly:
>>
>> ; generate indices for resampling without replacement to sub-sample the
>> HAMSR data
>>
>> n_retain = toint(ceil(0.8*dimsizes(time)))
>>
>> print(dimsizes(time))
>>
>> iwo = generate_sample_indices(n_retain,0)
>>
>> print(dimsizes(iwo))
>>
>>
>> 14398 - dimsizes(time)
>>
>> 11519 - dimsizes(iwo)
>>
>>
>> However, I noticed that maybe this may not be correct since it will only
>> select n_retain values, and thus may not randomly get indices from the full
>> dataset to subset. Is there a way to do this with the function without
>> having to do replacement?
>>
>>
>> Thanks,
>>
>>
>> --
>> Andrew Kren
>> Assistant Scientist
>> CIMAS & NOAA/AOML
>> 325 Broadway, Boulder, CO 80305
>> <https://maps.google.com/?q=325+Broadway,+Boulder,+CO+80305&entry=gmail&source=g>
>> (303) 497-5418
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
Andrew Kren
Assistant Scientist
CIMAS & NOAA/AOML
325 Broadway, Boulder, CO 80305
(303) 497-5418
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180601/c488869a/attachment.html>


More information about the ncl-talk mailing list