Project

General

Profile

« Previous | Next » 

Revision 86f774c2

Added by Benoit Parmentier over 10 years ago

run4 assessment NEX modification to plots for k-dimension gam fitting

View differences:

climate/research/oregon/interpolation/global_run_scalingup_assessment_part2.R
296 296

  
297 297
boxplot(rmse~k,data=subset(gam_diagnostic_df,pred_mod=="mod2"),main="mod2 and term=s(LST)",ylab="RMSE_f",xlab="k")
298 298

  
299
res_pix <-480
300

  
301
png(filename="test.png",
302
    width=0.5*res_pix,height=6*res_pix)
303

  
304 299
#boxplot(rmse~pred_mod,data=tb,ylim=c(0,5),outline=FALSE)#,names=tb$pred_mod)
305 300
#title("RMSE per model over all tiles")
306 301
#bwplot(rmse~k | term + month,data=subset(gam_diagnostic_df,pred_mod=="mod2"),)
......
315 310
       auto.key=list(space = "top", cex=1.0,columns=8))
316 311
dev.off()
317 312

  
318
boxplot(rmse~month,data=subset(gam_diagnostic_df,pred_mod=="mod2"))
319
boxplot(rmse~month,data=subset(gam_diagnostic_df,pred_mod=="mod1"))
320

  
321
gam_diagnostic_df$month <- as.factor(gam_diagnostic_df$month)
322
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod1"),main="mod1 and term=s(lat,lon)",ylab="RMSE_f",xlab="k")
323
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod2"),main="mod2 and term=s(lat,lon)",ylab="RMSE_f",xlab="k")
324
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod1"))
325
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod2"))
326

  
327
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(LST)" & pred_mod=="mod2"))
328

  
329
boxplot(rmse~n,data=subset(gam_diagnostic_df,pred_mod=="mod2"))
330
boxplot(rmse~n,data=subset(gam_diagnostic_df,pred_mod=="mod1"))
331

  
332
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod1" & tile_id=="tile_8"))
333
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod1" & tile_id=="tile_7"))
334
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod2" & tile_id=="tile_8"))
335
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod2" & tile_id=="tile_7"))
336
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod1" & tile_id=="tile_8"))
337
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod1" & tile_id=="tile_7"))
338

  
339
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod1" & tile_id=="tile_7" & month==1))
340
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod1" & tile_id=="tile_7" & month==7))
341

  
342
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod1" & tile_id=="tile_7" & month==1))
343
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod1" & tile_id=="tile_7" & month==7))
344

  
345
boxplot(rmse~month,data=subset(gam_diagnostic_df,pred_mod=="mod1" & tile_id=="tile_7"))
346
boxplot(rmse~month,data=subset(gam_diagnostic_df,pred_mod=="mod2" & tile_id=="tile_7"))
347 313

  
348
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(lat,lon)" & pred_mod=="mod2"))
349
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod1"))
350
boxplot(rmse~k,data=subset(gam_diagnostic_df,term=="s(elev_s)" & pred_mod=="mod2"))
351 314

  
352 315
plot(n~tile_id,data=gam_diagnostic_df,type="h")
353 316

  
317
## Experimenting
318
list_mod <- load_obj(lf_diagnostic_obj$tile_1[2])$list_mod
319
data_training_lf <- as.data.frame(list_mod[[1]]$model)
320
dim(data_training_lf) #is 13
321
mod_t1 <-gam(y_var ~ s(lat,lon,k=6) + s(elev_s,k=4) + s(LST,k=4) , data= data_training_lf)
322
mod_t2 <-gam(y_var ~ s(lat,lon,k=5) + s(elev_s,k=5) + s(LST,k=5) , data= data_training_lf)
323

  
324
list_mod <- load_obj(lf_diagnostic_obj$tile_7[4])$list_mod
325
data_training_lf <- as.data.frame(list_mod[[1]]$model)
326
dim(data_training_lf) #is 13
327
mod_t1 <-gam(y_var ~ s(lat,lon,k=6) + s(elev_s,k=4) + s(LST,k=4) , data= data_training_lf)
328
mod_t2 <-gam(y_var ~ s(lat,lon,k=5) + s(elev_s,k=5) + s(LST,k=5) , data= data_training_lf)
354 329

  
355 330
# 
356 331
## Figure 3b

Also available in: Unified diff