Project

General

Profile

« Previous | Next » 

Revision f31f59cc

Added by Benoit Parmentier over 12 years ago

GAM LST, changed triple nesting lat,long,Elev to double, 365 dates run, task #406 and #361

View differences:

climate/research/oregon/interpolation/GAM_LST_reg.R
22 22
path<-"H:/Data/IPLANT_project/data_Oregon_stations"
23 23
setwd(path) 
24 24
infile2<-"dates_interpolation_03052012.txt"                                          #List of 10 dates for the regression
25
infile2<-"list_365_dates_04212012.txt"
25 26
prop<-0.3                                                                            #Proportion of testing retained for validation   
26
out_prefix<-"_04142012_LST_r4"
27
out_prefix<-"_04212012_LST"
27 28
infile3<-"LST_dates_var_names.txt"
28 29
infile4<-"models_interpolation_04032012b.txt"
29 30

  
......
49 50
results_GCV<- matrix(1,length(dates),length(models)+2)
50 51
results_DEV<- matrix(1,length(dates),length(models)+2)
51 52
results_RMSE<- matrix(1,length(dates),length(models)+2)
52
cor_LST_LC1<-matrix(1,10,1)      #correlation LST-LC1
53
cor_LST_LC3<-matrix(1,10,1)      #correlation LST-LC3
54
cor_LST_tmax<-matrix(1,10,1)    #correlation LST-tmax
53
cor_LST_LC1<-matrix(1,length(dates),1)      #correlation LST-LC1
54
cor_LST_LC3<-matrix(1,length(dates),1)      #correlation LST-LC3
55
cor_LST_tmax<-matrix(1,length(dates),1)    #correlation LST-tmax
55 56
#Screening for bad values
56 57

  
57 58
ghcn_all<-ghcn
......
90 91
  ####Regression part 2: GAM models
91 92

  
92 93
  mod1<- gam(tmax~ s(lat) + s (lon) + s (ELEV_SRTM), data=data_s)
93
  mod2<- gam(tmax~ s(lat,lon,ELEV_SRTM), data=data_s)
94
  #mod2<- gam(tmax~ s(lat,lon,ELEV_SRTM), data=data_s)
95
  mod2<- gam(tmax~ s(lat,lon) + s(ELEV_SRTM), data=data_s)
94 96
  mod3<- gam(tmax~ s(lat) + s (lon) + s (ELEV_SRTM) +  s (Northness)+ s (Eastness) + s(DISTOC), data=data_s)
95 97
  mod4<- gam(tmax~ s(lat) + s (lon) + s(ELEV_SRTM) + s(Northness) + s (Eastness) + s(DISTOC) + s(LST), data=data_s)
96 98
  mod5<- gam(tmax~ s(lat,lon) +s(ELEV_SRTM) + s(Northness,Eastness) + s(DISTOC) + s(LST), data=data_s)

Also available in: Unified diff