SantanderMetGroup / downscaleR

An R package for climate data bias correction and downscaling (part of the climate4R bundle)
https://github.com/SantanderMetGroup/climate4R
GNU General Public License v3.0
102 stars 59 forks source link

NAs issues in downscale.train() #57

Open DanielaOsses opened 5 years ago

DanielaOsses commented 5 years ago

hello,

I'm having an issue in training data code (downscale.train) using analogs, because it generate NA data as results.

I've reviewed all the data that I used, and the observacional data has NAs, the reanalysis predictor does not have NA. After preparing the data with prepareData, data$x.global does not have NA and when I get to train the model, the result for Analog$pred$Data does have NAs.

Is there any way to train the model leaving aside the NAs? Because I tried adding na.rm = T, na.exclude, na.omit but it is not included in the analog function, only in GLM.

Thanks

jorgebanomedina commented 5 years ago

Hi Daniela,

I suppose that you are saying that some of your predictions are NaN but not all of them. This is because the correspondent analog belongs to a day where there was no value in yor observations. If you want to overcome the NaN problem in order to obtain your predictions with abolutely any NaN value then you can use the parameter "pool" of the downscale.train and analogs.train functions of the library downscaleR. Anyway, here is the description of the parameter just in case:

pool:    An integer. Number of auxiliary analogs in case there are NaN or NA in the original analogs.

You just introduce this parameter in yor downscale.train function such as: downscale.train(x,y,pool = 2,...)

Please notice us if you still have problems with this issue!

Regards,

Jorge

El 6/2/19 a las 21:35, DanielaOsses escribió:

hello,

I'm having an issue in training data code (downscale.train) using analogs, because it generate NA data as results.

I've reviewed all the data that I used, and the observacional data has NAs, the reanalysis predictor does not have NA. After preparing the data with prepareData, data$x.global does not have NA and when I get to train the model, the result for Analog$pred$Data does have NAs.

Is there any way to train the model leaving aside the NAs? Because I tried adding na.rm = T, na.exclude, na.omit but it is not included in the analog function, only in GLM.

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SantanderMetGroup/downscaleR/issues/57, or mute the thread https://github.com/notifications/unsubscribe-auth/ATg44UmjFQFJMDY67s3LecnTAvAnWDl9ks5vKzysgaJpZM4amDpb.

DanielaOsses commented 5 years ago

Hi Jorge, Thanks for the help. But, the pool argument doesn't work on downscale.train(). I still have NAs as results after using the argument, even when I used pool=100.

I send you the session info if it helps in any way,

sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] mapdata_2.3.0 RColorBrewer_1.1-2 maps_3.3.0 visualizeR_1.3.1 sm_2.2-5.6 downscaleR_3.0.5
[7] glmnet_2.0-16 foreach_1.4.4 Matrix_1.2-14 deepnet_0.2 transformeR_1.4.7 loadeR_1.4.9
[13] loadeR.java_1.1.1 rJava_0.9-10

loaded via a namespace (and not attached): [1] Rcpp_1.0.0 compiler_3.5.1 bitops_1.0-6 iterators_1.0.10 tools_3.5.1
[6] vioplot_0.2 boot_1.3-20 dotCall64_1.0-0 evd_2.3-3 gtable_0.2.0
[11] lattice_0.20-35 parallel_3.5.1 spam_2.2-0 akima_0.6-2 gridExtra_2.3
[16] padr_0.4.1 raster_2.8-4 mapplots_1.5.1 gridGraphics_0.3-0 fields_9.6
[21] grid_3.5.1 data.table_1.11.8 dtw_1.20-1 pbapply_1.3-4 tcltk_3.5.1
[26] SpecsVerification_0.5-2 sp_1.3-1 latticeExtra_0.6-28 magrittr_1.5 scales_1.0.0
[31] CircStats_0.2-6 codetools_0.2-15 MASS_7.3-50 abind_1.4-5 colorspace_1.3-2
[36] proxy_0.4-22 munsell_0.5.0 RCurl_1.95-4.11 easyVerification_0.4.4 verification_1.42
[41] RcppEigen_0.3.3.5.0