Project

General

Profile

« Previous | Next » 

Revision a449dc3e

Added by Benoit Parmentier over 11 years ago

master script, running first predictions of temp using kriging fusion in OR

View differences:

climate/research/oregon/interpolation/master_script_temp.R
10 10
#STAGE 5: Output analyses: assessment of results for specific dates...
11 11
#
12 12
#AUTHOR: Benoit Parmentier                                                                       
13
#DATE: 07/21/2013                                                                                 
13
#DATE: 07/27/2013                                                                                 
14 14

  
15 15
#PROJECT: NCEAS INPLANT: Environment and Organisms --TASK#363, TASK$568--   
16 16

  
......
48 48

  
49 49
##SCRIPT USED FOR THE PREDICTIONS: Source or list all scripts here to avoid confusion on versions being run!!!!
50 50

  
51
#source(file.path(script_path,"master_script_temp_07232013.R")) #Master script can be run directly...
51
#source(file.path(script_path,"master_script_temp_0762013.R")) #Master script can be run directly...
52 52

  
53 53
#CALLED FROM MASTER SCRIPT:
54 54

  
......
58 58
#source(file.path(script_path,"download_and_produce_MODIS_LST_climatology_06112013.R"))
59 59
source(file.path(script_path,"covariates_production_temperatures_07172013.R"))
60 60
source(file.path(script_path,"Database_stations_covariates_processing_function_06112013.R"))
61
source(file.path(script_path,"GAM_fusion_analysis_raster_prediction_multisampling_07172013.R"))
61
source(file.path(script_path,"GAM_fusion_analysis_raster_prediction_multisampling_07272013.R"))
62 62
source(file.path(script_path,"results_interpolation_date_output_analyses_06112013.R"))
63 63
#source(file.path(script_path,"results_covariates_database_stations_output_analyses_04012013.R")) #to be completed
64 64

  
65 65
#FUNCTIONS CALLED FROM GAM ANALYSIS RASTER PREDICTION ARE FOUND IN...
66 66

  
67 67
source(file.path(script_path,"sampling_script_functions_03122013.R"))
68
source(file.path(script_path,"GAM_fusion_function_multisampling_07022013.R")) #Include GAM_CAI
68
source(file.path(script_path,"GAM_fusion_function_multisampling_07272013.R")) #Include GAM_CAI
69 69
source(file.path(script_path,"interpolation_method_day_function_multisampling_07052013.R")) #Include GAM_day
70 70
source(file.path(script_path,"GAM_fusion_function_multisampling_validation_metrics_05062013.R"))
71 71

  
......
77 77
#If stage 3 is skipped then use previous met_stations object
78 78
met_stations_outfiles_obj_file<-"/data/project/layers/commons/data_workflow/output_data_365d_gam_fus_lst_test_run_07172013/met_stations_outfiles_obj_gam_fusion__365d_gam_fus_lst_test_run_07172013.RData"
79 79

  
80

  
81 80
var<-"TMAX" # variable being interpolated
82
out_prefix<-"_365d_gam_day_mults15_lst_comb3_07232013"                #User defined output prefix
83
out_suffix<-"_OR_07232013"                                       #Regional suffix
81
out_prefix<-"_365d_kriging_fus_lst_comb3_07282013"                #User defined output prefix
82
out_suffix<-"_OR_07282013"                                       #Regional suffix
84 83
out_suffix_modis <-"_05302013"                       #pattern to find tiles produced previously     
85 84

  
86 85
#interpolation_method<-c("gam_fusion","gam_CAI","gam_daily") #other otpions to be added later
87 86
#interpolation_method<-c("gam_CAI") #other otpions to be added later
88 87
#interpolation_method<-c("gam_fusion") #other otpions to be added later
89
interpolation_method<-c("gam_daily") #other otpions to be added later
88
interpolation_method<-c("kriging_fusion") #other otpions to be added later
89
#interpolation_method<-c("gam_daily") #other otpions to be added later
90 90
#interpolation_method<-c("kriging_daily") #other otpions to be added later
91 91
#interpolation_method<-c("gwr_daily") #other otpions to be added later
92 92

  
......
236 236
#Set additional parameters
237 237
#Input for sampling function...
238 238
seed_number<- 100  #if seed zero then no seed?     
239
nb_sample<-10           #number of time random sampling must be repeated for every hold out proportion
240
step<-0.1         
239
nb_sample<-1           #number of time random sampling must be repeated for every hold out proportion
240
step<-0         
241 241
constant<-0             #if value 1 then use the same samples as date one for the all set of dates
242
prop_minmax<-c(0.1,0.7)  #if prop_min=prop_max and step=0 then predicitons are done for the number of dates...
242
prop_minmax<-c(0.3,0.3)  #if prop_min=prop_max and step=0 then predicitons are done for the number of dates...
243 243
#dates_selected<-c("20100101","20100102","20100103","20100901") # Note that the dates set must have a specific format: yyymmdd
244
dates_selected<-c("20100101","20100102","20100301","20100302","20100501","20100502","20100701","20100702","20100901","20100902","20101101","20101102")
245
#dates_selected<-"" # if empty string then predict for the full year specified earlier
244
#dates_selected<-c("20100101","20100102","20100301","20100302","20100501","20100502","20100701","20100702","20100901","20100902","20101101","20101102")
245
dates_selected<-"" # if empty string then predict for the full year specified earlier
246 246
screen_data_training<-FALSE #screen training data for NA and use same input training for all models fitted
247 247

  
248 248
#Models to run...this can be changed for each run
249 249
#LC1: Evergreen/deciduous needleleaf trees
250 250

  
251 251
#Combination 3: for paper baseline=s(lat,lon)+s(elev)
252
list_models<-c("y_var ~ s(lat,lon) + s(elev_s)",
253
              "y_var ~ s(lat,lon) + s(elev_s) + s(N_w)",
254
              "y_var ~ s(lat,lon) + s(elev_s) + s(E_w)",
255
              "y_var ~ s(lat,lon) + s(elev_s) + s(LST)",
256
              "y_var ~ s(lat,lon) + s(elev_s) + s(DISTOC)",
257
              "y_var ~ s(lat,lon) + s(elev_s) + s(LC1)",
258
              "y_var ~ s(lat,lon) + s(elev_s) + s(CANHGHT)",
259
              "y_var ~ s(lat,lon) + s(elev_s) + s(LST) + ti(LST,LC1)",
260
              "y_var ~ s(lat,lon) + s(elev_s) + s(LST) + ti(LST,CANHGHT)")
252
# list_models<-c("y_var ~ s(lat,lon) + s(elev_s)",
253
#               "y_var ~ s(lat,lon) + s(elev_s) + s(N_w)",
254
#               "y_var ~ s(lat,lon) + s(elev_s) + s(E_w)",
255
#               "y_var ~ s(lat,lon) + s(elev_s) + s(LST)",
256
#               "y_var ~ s(lat,lon) + s(elev_s) + s(DISTOC)",
257
#               "y_var ~ s(lat,lon) + s(elev_s) + s(LC1)",
258
#               "y_var ~ s(lat,lon) + s(elev_s) + s(CANHGHT)",
259
#               "y_var ~ s(lat,lon) + s(elev_s) + s(LST) + ti(LST,LC1)",
260
#               "y_var ~ s(lat,lon) + s(elev_s) + s(LST) + ti(LST,CANHGHT)")
261

  
262
list_models<-c("y_var ~ lat*lon + elev_s",
263
              "y_var ~ lat*lon + elev_s + N_w",
264
              "y_var ~ lat*lon + elev_s + E_w",
265
              "y_var ~ lat*lon + elev_s + LST",
266
              "y_var ~ lat*lon + elev_s + DISTOC",
267
              "y_var ~ lat*lon + elev_s + LC1",
268
              "y_var ~ lat*lon + elev_s + CANHGHT",
269
              "y_var ~ lat*lon + elev_s + LST + I(LST*LC1)",
270
              "y_var ~ lat*lon + elev_s + LST + I(LST*CANHGHT)")
271

  
261 272
#Default name of LST avg to be matched               
262 273
lst_avg<-c("mm_01","mm_02","mm_03","mm_04","mm_05","mm_06","mm_07","mm_08","mm_09","mm_10","mm_11","mm_12")  
263 274

  

Also available in: Unified diff