{"id":129,"date":"2016-06-11T07:31:27","date_gmt":"2016-06-11T07:31:27","guid":{"rendered":"http:\/\/www.uncertain-future.org.uk\/?page_id=129"},"modified":"2016-06-11T07:44:46","modified_gmt":"2016-06-11T07:44:46","slug":"hsy-sensitivity-analysis","status":"publish","type":"page","link":"http:\/\/www.uncertain-future.org.uk\/?page_id=129","title":{"rendered":"HSY Global Sensitivity Analysis"},"content":{"rendered":"<p>These routines implement the Hornberger-Spear-Young\u00a0method of Global\u00a0Sensitivity Analysis (GSA) or Regionalised Sensitivity Analysis (RSA) with enhancements to looking at differences between multiple classes of model outputs.<\/p>\n<p><u>Libraries<\/u><\/p>\n<p>No special library routines are required for these routines<\/p>\n<p><u>Download<\/u><\/p>\n<p>Download sample code and data file for GSA routines\u00a0[<a href=\"http:\/\/www.uncertain-future.org.uk\/wp-content\/uploads\/2016\/06\/R-HSY_GSA.zip\"><em>Here<\/em><\/a>]<\/p>\n<p><u>Procedure<\/u><\/p>\n<p><strong>The Input data file<\/strong><\/p>\n<p>The forms of sensitivity analysis explored here make use of a file of model results from Monte Carlo experiments stored in a data file.\u00a0 This should have the form (explanations of each line given as comments: npar is number of parameters, nlik is number of likelihood measures, nvar is number of predicted variables, nrun is number of model realisations):<\/p>\n<p>&nbsp;<\/p>\n<p>&#8220;Slapton Wood catchment&#8221;\u00a0 \u00a0\u00a0\u00a0\u00a0# title<\/p>\n<p>4,3,7,1000\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u00a0npar,nlik,nvar,nrun<\/p>\n<p>&#8221;\u00a0 M\u00a0\u00a0\u00a0\u00a0 &#8220;,.02,.05\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # parameter name, min and max values<\/p>\n<p>&#8221; LnTo\u00a0\u00a0 &#8220;,1,10<\/p>\n<p>&#8221; SRmax\u00a0 &#8220;,.005,.05<\/p>\n<p>&#8221; SRinit &#8220;,0,1<\/p>\n<p>&#8221; Eff\u00a0\u00a0\u00a0 &#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # likelihood measure names, index=1<\/p>\n<p>&#8221; 1\/SLE\u00a0\u00a0\u00a0 &#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 index=2<\/p>\n<p>&#8221; 1\/SAE\u00a0\u00a0\u00a0 &#8221;<\/p>\n<p>&#8221; Vol. Q &#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # predicted variable names, index =nlik+1<\/p>\n<p>&#8221; Max Ac% &#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 index=nlik+2<\/p>\n<p>&#8221; % Ac Q &#8221;<\/p>\n<p>&#8221; % BF Q &#8221;<\/p>\n<p>&#8220;t=100&#8221;<\/p>\n<p>&#8220;t=290&#8221;<\/p>\n<p>&#8220;t=800&#8221;<\/p>\n<p>2.594035E-02,5.459364,2.187394E-02,.8582671,.8107379,2.647838E-02\u2026\u2026#values of parameters, likelihoods, and predictions for each model run.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Dotty Plots<\/strong><\/p>\n<p>A very basic way of testing the sensitivity to different types of output is to make \u201cdotty plots\u201d which are simple scatter plots of parameter value against model output (either a likelihood value or a value for a predicted variable).\u00a0\u00a0 The routine to call the plots is:<\/p>\n<p>dotty (\u201cfilename\u201d, index, threshold)<\/p>\n<p>where\u00a0index\u00a0is the selected likelihood or predicted variable index and\u00a0threshold\u00a0is the chosen limit between the behavioural and nonbehavioural classes.<\/p>\n<p>Dotty plots are found in many GLUE papers and often show that when parameter values are plotted against likelihoods, good fits to the data are found across a wide range of parameter values (the equifinality issue).<\/p>\n<p>It is worth remembering, however, that the dotty plot is a projection of points on the response surface in the model space onto single parameter axes.\u00a0 This means that any interactions between different parameters in producing a good model fit will not be revealed by this form of plot.\u00a0 For example a long sharp ridge in the response surface (characteristic of strongly interacting parameters) would appear as equally good models in the dotty plot.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>HSY Generalised Sensitivity Analysis. (See Section 3.5 in\u00a0<\/strong><strong>Environmental Modelling: An Uncertain Future?<\/strong><strong>)<\/strong><\/p>\n<p>The following routines written in R allow the user to carry out HSY GSA given either likelihood evaluations or single predicted variables from multiple Monte Carlo realisations of a model run with different parameter sets.\u00a0 Both approaches use the same input data file format.<\/p>\n<p>In Hornberger\/Spear\/Young GSA the model runs are split into different classes depending on the value of a likelihood or predicted variable value.<\/p>\n<p>Two variants are provided:\u00a0 the first follows the original approach of Hornberger and Spear (1981) \u00a0in using two classes (behavioural and non-behavioural) depending on a simple threshold.\u00a0\u00a0 This may be called as:<\/p>\n<p>hsy_gsa (\u201cfilename\u201d, index, threshold)<\/p>\n<p>where\u00a0index\u00a0is the selected likelihood or predicted variable index and\u00a0threshold\u00a0is the chosen limit between the behavioural and nonbehavioural classes.<\/p>\n<p>The results are plotted as cumulative distributions of parameter values in each class for each parameter.<\/p>\n<p>A large difference between the distributions for a parameter indicates that the simulations are sensitive to that parameter.<\/p>\n<p>A somewhat more detailed impression of the sensitivity for each parameter can be obtained by using more than one class.\u00a0 The routine<\/p>\n<p>gsa_n_classes (\u201cfilename\u201d, index, nclasses)<\/p>\n<p>where\u00a0nclasses\u00a0is the number of classes to be used in subdividing the model runs on the basis of the value of likelihood or predicted value.<\/p>\n<p><strong>\u00a0\u00a0<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>These routines implement the Hornberger-Spear-Young\u00a0method of Global\u00a0Sensitivity Analysis (GSA) or Regionalised Sensitivity Analysis (RSA) with enhancements to looking at differences between multiple classes of model outputs. Libraries No special library routines are required for these routines Download Download sample code and data file for GSA routines\u00a0[Here] Procedure The Input data file The forms of sensitivity &hellip; <a href=\"http:\/\/www.uncertain-future.org.uk\/?page_id=129\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">HSY Global Sensitivity Analysis<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":28,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-129","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":3,"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/129\/revisions"}],"predecessor-version":[{"id":140,"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/129\/revisions\/140"}],"up":[{"embeddable":true,"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/28"}],"wp:attachment":[{"href":"http:\/\/www.uncertain-future.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}