Project

General

Profile

« Previous | Next » 

Revision f684a69f

Added by Benoit Parmentier over 10 years ago

revisions2 multi-timescale paper adding comp between mod1 and mod4 (LST and elev) rmse

View differences:

climate/research/oregon/interpolation/multi_timescale_paper_interpolation.R
42 42
#### FUNCTION USED IN SCRIPT
43 43

  
44 44
function_analyses_paper1 <-"contribution_of_covariates_paper_interpolation_functions_07182014.R" #first interp paper
45
function_analyses_paper2 <-"multi_timescales_paper_interpolation_functions_08122014.R"
45
function_analyses_paper2 <-"multi_timescales_paper_interpolation_functions_08132014.R"
46 46

  
47 47
##############################
48 48
#### Parameters and constants  
......
194 194
table3_paper <- subset(table3_paper,
195 195
                       select=grep("gam_fss",names(table3_paper),invert=T,value=T))
196 196

  
197
list_tb <-lapply(list_raster_oj_files,FUN=function(x){x<-load_obj(x);x[["tb_diagnostic_v"]]})                           
197
list_tb <-lapply(list_raster_obj_files,FUN=function(x){x<-load_obj(x);x[["tb_diagnostic_v"]]})                           
198 198

  
199 199
stat<-"sd"
200 200
training <- "FALSE"
......
370 370
file_name<-paste("table6_correlation_multi_timescale_paper","_",out_prefix,".txt",sep="")
371 371
write.table(table6,file=file_name,sep=",")
372 372

  
373
### Additiona information:
374

  
375
#model with LST and elev
376
raster_obj <- load_obj(list_raster_obj_files$gam_CAI)
377

  
378
list_tb_mod_month <- vector("list",length=3)
379
interp_method_selected <- c("gam_CAI","kriging_CAI","gwr_CAI")
380
for(i in 1:3){
381
  raster_obj <- load_obj(list_raster_obj_files[[interp_method_selected[i]]])
382
  tb1_mod1_month <- raster_obj$summary_month_metrics_v[[1]] #note that this is for model1
383
  tb_mod_month <- raster_obj$summary_month_metrics_v[1:7]#note that this is for model1
384
  tb_mod_month <- as.data.frame(do.call(rbind,tb_mod_month))
385
  tb_mod_month <- tb_mod_month[,c("month","rmse","pred_mod")]
386
  tb_mod_month$m <- as.numeric(tb_mod_month$month)
387
  xyplot(rmse~m, group=pred_mod,data=tb_mod_month,type="b",
388
         auto.key=list(space = "top", cex=1.0,columns=7))
389
  test <- list(
390
      tb_mod_month[tb_mod_month$pred_mod=="mod1",c("rmse")],
391
      tb_mod_month[tb_mod_month$pred_mod=="mod2",c("rmse")],
392
      tb_mod_month[tb_mod_month$pred_mod=="mod3",c("rmse")],
393
      tb_mod_month[tb_mod_month$pred_mod=="mod4",c("rmse")],
394
      tb_mod_month[tb_mod_month$pred_mod=="mod5",c("rmse")],
395
      tb_mod_month[tb_mod_month$pred_mod=="mod6",c("rmse")],
396
      tb_mod_month[tb_mod_month$pred_mod=="mod7",c("rmse")])
397
  test<- as.data.frame(do.call(cbind,test))
398
  names(test) <- paste("mod",1:7,sep="")
399
  test$month <- tb_mod_month$month[1:12]     
400

  
401
  test[,c(3,6,7)]
402
  list_tb_mod_month[[i]] <-  test
403

  
404
}
405

  
406
list_tb_mod_month[[1]][,c(3,6,7)]
407
list_tb_mod_month[[2]][,c(3,6,7)]
408
list_tb_mod_month[[3]][,c(3,6,7)]
409
#xyplot(test)
410

  
411
list_tb_mod_month[[1]][,c(6,7)]-list_tb_mod_month[[1]][,c(3)]
412
list_tb_mod_month[[2]][,c(6,7)]-list_tb_mod_month[[1]][,c(3)]
413
list_tb_mod_month[[3]][,c(6,7)]-list_tb_mod_month[[1]][,c(3)]
414

  
415
#model with lev only
416
tb1_mod1_month <- raster_prediction_obj_1$summary_month_metrics_v[[1]] #note that this is for model1
417

  
418
tb1_mod1_month<-raster_prediction_obj_1$summary_month_metrics_v[[1]] #note that this is for model1
419
rmse_dif <- (tb1_mod4_month$rmse) - tb1_mod1_month$rmse
420
plot(rmse_dif)
421

  
422

  
373 423
#######################################################
374 424
####### PART 2: generate figures for paper #############
375 425

  

Also available in: Unified diff