Our goal was to run a sensitivity analysis on the output of an ensemble model
First we built a kriging model, which estimates parameters through maximum likelihood, with function DiceKriging::km(), the model output was used for building a latin hypercube emulator, which was then fed to the Fourier Amplitude Sensitivity Test.
“variance estimate of 17.19 was obtained through function km from package DiceKriging (Roustant et al., 2012)”
Output from the emulator
n =21# number of points in to vary# (elio) this is the part of the emulator OAAT: "one at a time" variable changingX_oaat =oaat.design(design=cuiki[,-6], n = n, hold = X.standard)colnames(X_oaat) =colnames(cuiki[,-6])# (elio) the model outputpred_grd_oaat =predict(fit_grd, newdata = X_oaat, type ='UK')# (elio) plots are almost the same, only logqvar is visibly differentpar(mfrow =c(2,4), las =1, mar =c(5,3,2,1), oma =c(0.1,3,0.1,0.1))for(i in1:ncol(X_oaat)){# just the points where the parameter varies ix <-seq(from = ((i*n) - (n-1)), to = (i*n), by =1)plot(X_oaat[ix, i], pred_grd_oaat$mean[ix], ylim =c(0, 900), bty ='n',ylab ='', type ='l', lwd =2,xlab =colnames(cuiki[,-6])[i] )lines(X_oaat[ix, i], pred_grd_oaat$upper95[ix], lty ='dashed')lines(X_oaat[ix, i], pred_grd_oaat$lower95[ix], lty ='dashed')}legend('topright', lty =c('solid', 'dashed'), lwd =c(2,1), legend =c('mean','95% CI'))mtext('habitat suitability', side =2, line =1, col ='black', outer =TRUE, las =0)
FAST: Fourier amplitude sensitivity test
Here we run the FAST analysis on the pred_grd_oaat object from the emulator. We found the highest fourier coeficients for degree of regulation and bio7
paras =fast_parameters(min =c(27.60000, 75.88765, 308.00000, 0.00000, 63.00000, 0.00000, 0.38227, 0.97400 ),max =c(36.5, 140.987823486328, 4825, 693, 337, 19, 0.611429989337921, 245.130996704102))# (elio) the model needs 243 records (no idea how they came up with that number)# ...... so I pasted twice the vectorpar(mfrow =c(1,1))fast::sensitivity(c(pred_grd_oaat$mean, pred_grd_oaat$mean), numberf =8, n =2, make.plot = T, names =names(cuiki[,-6]))