Home > mrg > MRG_modelcomp > mrg_gofstat2xls.m

mrg_gofstat2xls

PURPOSE ^

This function provides a simple output of the goodness-of-fit statistics

SYNOPSIS ^

function mrg_gofstat2xls(gofstat)

DESCRIPTION ^

 This function provides a simple output of the goodness-of-fit statistics 
 as given by mrg_gofstat in structure format to xlsx file in a simple 
 sheet format with some commenting and headers. 

 INPUT
   gofstat as provided by mrg_gofstat or mrg_dfs0_gofstat

 OUTPUT
    The excel file with two colums if one data set is used, or else more

 USAGE
   Simply get the gofstat output from mrg_gofstat and run the function,
   e.g.

   out = mrg_dfs0_gofstat
   mrg_gofstat2xls(out)

 OCTAVE COMPATIBILITY
   Untested.

 AUTHORS
   Bjoern Elsaesser @ QUB

 LICENCE
   Code distributed as part of the MRG toolbox from the Marine Research
   Group at Queens Univeristy Belfast (QUB) School of Planning
   Architecture and Civil Engineering (SPACE). Distributed under a
   creative commons CC BY-SA licence, retaining full copyright of the
   original authors.

   http://creativecommons.org/licenses/by-sa/3.0/
   http://www.qub.ac.uk/space/
   http://www.qub.ac.uk/research-centres/eerc/

 DEVELOPMENT
   v 1.0   2013-11-28
           First version. BE

 TODO
   Make code prettier and faster


% not much to it!

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mrg_gofstat2xls(gofstat)
0002 % This function provides a simple output of the goodness-of-fit statistics
0003 % as given by mrg_gofstat in structure format to xlsx file in a simple
0004 % sheet format with some commenting and headers.
0005 %
0006 % INPUT
0007 %   gofstat as provided by mrg_gofstat or mrg_dfs0_gofstat
0008 %
0009 % OUTPUT
0010 %    The excel file with two colums if one data set is used, or else more
0011 %
0012 % USAGE
0013 %   Simply get the gofstat output from mrg_gofstat and run the function,
0014 %   e.g.
0015 %
0016 %   out = mrg_dfs0_gofstat
0017 %   mrg_gofstat2xls(out)
0018 %
0019 % OCTAVE COMPATIBILITY
0020 %   Untested.
0021 %
0022 % AUTHORS
0023 %   Bjoern Elsaesser @ QUB
0024 %
0025 % LICENCE
0026 %   Code distributed as part of the MRG toolbox from the Marine Research
0027 %   Group at Queens Univeristy Belfast (QUB) School of Planning
0028 %   Architecture and Civil Engineering (SPACE). Distributed under a
0029 %   creative commons CC BY-SA licence, retaining full copyright of the
0030 %   original authors.
0031 %
0032 %   http://creativecommons.org/licenses/by-sa/3.0/
0033 %   http://www.qub.ac.uk/space/
0034 %   http://www.qub.ac.uk/research-centres/eerc/
0035 %
0036 % DEVELOPMENT
0037 %   v 1.0   2013-11-28
0038 %           First version. BE
0039 %
0040 % TODO
0041 %   Make code prettier and faster
0042 %
0043 %
0044 %% not much to it!
0045 
0046 % define the excel file for the data to be written to
0047 [FileName,PathName,FilterIndex] = uiputfile('*.xlsx','Choose filename for data','GoF_Stat.xlsx');
0048 
0049 cd(PathName);
0050 
0051 % write correlation data
0052 text = {'Correlation coefficient (R)'};
0053 xlswrite(FileName,text,'Corr','A1');
0054 text = {'Lower 95% confidence limit on R'};
0055 xlswrite(FileName,text,'Corr','A2');
0056 text = {'Upper 95% confidence limit on R'};
0057 xlswrite(FileName,text,'Corr','A3');
0058 text = {'p-value on R'};
0059 xlswrite(FileName,text,'Corr','A4');
0060 xlswrite(FileName,gofstat.corr.','Corr','B1');
0061 
0062 % write bias data
0063 text = {'NaN Mean of the pairwise differences'};
0064 xlswrite(FileName,text,'Corr','A5');
0065 text = {'NaN Mean of the absolute pairwise differences'};
0066 xlswrite(FileName,text,'Corr','A6');
0067 text = {'Standard Deviation of pairwise differences'};
0068 xlswrite(FileName,text,'Corr','A7');
0069 text = {'Bias-index - bias / mean'};
0070 xlswrite(FileName,text,'Corr','A8');
0071 xlswrite(FileName,gofstat.bias.','Corr','B5');
0072 
0073 % write RMS data
0074 text = {'root mean square'};
0075 xlswrite(FileName,text,'Corr','A9');
0076 text = {'scatter index (RMS/Obar)'};
0077 xlswrite(FileName,text,'Corr','A10');
0078 text = {'scatter index using abs of signal (RMS/abs(Obar))'};
0079 xlswrite(FileName,text,'Corr','A11');
0080 text = {'stdev of the differences (different to bias stdev)'};
0081 xlswrite(FileName,text,'Corr','A12');
0082 xlswrite(FileName,gofstat.RMS.','Corr','B9');
0083 
0084 % write remaining stats of means
0085 xlswrite(FileName,gofstat.Pbar.','Corr','B13');
0086 text = {'Pbar : The nanmean of Pred'};
0087 xlswrite(FileName,text,'Corr','A13');
0088 xlswrite(FileName,gofstat.Obar.','Corr','B14');
0089 text = {'Obar : The nanmean of Obs'};
0090 xlswrite(FileName,text,'Corr','A14');
0091 xlswrite(FileName,gofstat.absPbar.','Corr','B15');
0092 text = {'absPbar : The nanmean of abs(Pred)'};
0093 xlswrite(FileName,text,'Corr','A15');
0094 xlswrite(FileName,gofstat.absObar.','Corr','B16');
0095 text = {'absObar : The nanmean of abs(Obs)'};
0096 xlswrite(FileName,text,'Corr','A16');
0097 
0098 % write remaining stats of goodness of fit
0099 xlswrite(FileName,gofstat.MEF.','Corr','B17');
0100 text = {'MEF  : The modelling efficency as per Stow 2009'};
0101 xlswrite(FileName,text,'Corr','A17');
0102 xlswrite(FileName,gofstat.skill.','Corr','B18');
0103 text = {'skill: The modelling skill as per Dias 2009'};
0104 xlswrite(FileName,text,'Corr','A18');
0105 xlswrite(FileName,gofstat.RI.','Corr','B19');
0106 text = {'RI   : The reliability index'};
0107 xlswrite(FileName,text,'Corr','A19');
0108 
0109 end

Generated on Thu 29-May-2014 21:29:53 by m2html © 2005