# this file gives the overall sequence of R calculations for the figures used in the # Schmidt, Mann and Rutherford comment on the McShane and Wyner (2010) paper. # Code is adapted from McShane and Wyner (2010) along with input from # http://probabilitynotes.wordpress.com for the MCMC emulation. # Please report any problems or errors to Gavin Schmidt # NOTE: THE FILE R_les_proxy.txt HAS BEEN CORRECTED (SEE FILE FOR DETAILS) (DEC 16 2010) ### Fig 1, (c.f. fig 14 in MW) and Figs. S1, S2 source("R_recon_orig.txt") source("R_add_eiv+cru.txt") yhat_orig_ann = yhat yhat_orig_sm = yhat_sm pc_sdev_orig = proxy_pc$sdev tilj="no" source("R_recon_correct_proxies_notilj.txt") yhat_correct_ann = yhat yhat_correct_sm = yhat_sm pc_sdev_correct_notilj = proxy_pc$sdev # plot fig 1a pdffile="SMR_fig1a.pdf" title1="Impact of proper proxy selection + no Tiljander" yhat_orig = yhat_orig_sm yhat_correct = yhat_correct_sm source("R_SMR_fig1aS1.txt") print("Fig 1a done...") ### plot fig S1 (as fig1a but this time including Tiljander proxies). tilj="yes" source("R_recon_correct_proxies_notilj.txt") yhat_correct2_ann = yhat yhat_correct2_sm = yhat_sm pc_sdev_correct = proxy_pc$sdev pdffile="SMR_figS1.pdf" title1="Impact of proper proxy selection (incl. Tiljander)" yhat_orig = yhat_orig_sm yhat_correct = yhat_correct2_sm source("R_SMR_fig1aS1.txt") print("Fig S1 done...") ### plot fig S2 (as fig 1a but with annual data) pdffile="SMR_figS2.pdf" title1="Impact of proper proxy selection + no Tiljander" yhat_orig = yhat_orig_ann yhat_correct = yhat_correct_ann source("R_SMR_figS2.txt") print("Fig S2 done...") ### plot fig S3 (impact of using lowpassed data and different calibration interval) endyr=1980 source("R_recon_lowpass.txt") yhat2=yhat ppc_out2=ppc_out endyr=1995 source("R_recon_lowpass.txt") pdffile="SMR_figS3.pdf" source("R_SMR_figS3.txt") print("Fig S3 done...") ### plot fig S4 (log eigenvalue spectra for the proxy PC networks) # needs previous calculated pc_sdev_* arrays # CORRECTED VERSION (DEC 16 2010) SEE FILE FOR DETAILS pdffile="SMR_figS4_corr.pdf" source("R_les_proxy.txt") print("Fig S4 done...") ### plots for fig 2: Two versions of pseudo proxy tests with two different models # data for table S1 is also produced # pseudo_GKSS_59.pdf and pseudo_CSM_59.pdf # pseudo_GKSS_104.pdf and pseudo_CSM_104.pdf num=59 # 59 proxy network src="GKSS" # choice of simulation source("R_pseudo.txt") src="CSM" source("R_pseudo.txt") num=104 # 104 proxy network src="GKSS" # choice of simulation source("R_pseudo.txt") src="CSM" source("R_pseudo.txt") print("Fig 2 done...") ### plots for fig 1b/1c # Use MCMC techniques to estimate errors in reconstructions using # correct proxy selection and no Tiljander proxies, with OLS PC10 and OLS PC4 # Note that this is a stochastic calculation and exact reproducibilty from one # run of jags to another is not expected. # set up PCs and input data numpc <- 10 source("bayesmodel/R_bayes_setup.txt") source("bayesmodel/R_jags.txt") # first plot pdffile1="SMR_fig1b.pdf" source("bayesmodel/R_SMR_fig1bc.txt") source("bayesmodel/R_posterior_probs.txt") # set up case for OLS PC4 numpc <- 4 source("bayesmodel/R_bayes_setup.txt") source("bayesmodel/R_jags.txt") # second plot pdffile1="SMR_fig1c.pdf" source("bayesmodel/R_SMR_fig1bc.txt") source("bayesmodel/R_posterior_probs.txt") print("Figs 1b/c done...")