• 大小: 111KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-18
  • 语言: Matlab
  • 标签: 泰勒图  

资源简介

泰勒图是一种的可以表示标准差, 均方根误差和相关系数三个指标的图,比直角坐标表现形式更加丰富

资源截图

代码片段和文件信息

% STATM Compute statistics from 2 series
%
% STATM = allstats(CrCf)
%
% Compute statistics from 2 series considering Cr as the reference.

% Inputs:
% Cr and Cf are of same length and uni-dimensional. They may contain NaNs.
%
% Outputs:
%  STATM(1:) => Mean
%  STATM(2:) => Standard Deviation (scaled by N)
%  STATM(3:) => Centered Root Mean Square Difference (scaled by N)
%  STATM(4:) => Correlation
%
% Notes:
% - N is the number of points where BOTH Cr and Cf are defined
%
%  - NaN are handled in the following way: because this function
%  aims to compair 2 series statistics are computed with indices
% where both Cr and Cf are defined.
%
%  - STATM(:1) are from Cr (ie with C=Cr hereafter)
%    STATM(:2) are from Cf versus Cr (ie with C=Cf hereafter)
%
% - The MEAN is computed using the Matlab mean function.
%
% - The STANDARD DEVIATION is computed as:
%           /  sum[ {C-mean(C)} .^2]  \
% STD = sqrt|  ---------------------  |
%           \          N              /
%
% - The CENTERED ROOT MEAN SQUARE DIFFERENCE is computed as:
%            /  sum[  { [C-mean(C)] - [Cr-mean(Cr)] }.^2  ]  \
% RMSD = sqrt|  -------------------------------------------  |
%            \                      N                        /
%
% - The CORRELATION is computed as:
%       sum( [C-mean(C)].*[Cr-mean(Cr)] ) 
% COR = --------------------------------- 
%               N*STD(C)*STD(Cr)
%
% - STATM(31) = 0 and STATM(41) = 1 by definition !
%
% Created by Guillaume Maze on 2008-10-28.
% Rev. by Guillaume Maze on 2010-02-10: Add NaN values handling some checking
% in the inputs and a more complete help
% Copyright (c) 2008 Guillaume Maze. 
% http://codes.guillaumemaze.org




%
% This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
% the Free Software Foundation either version 3 of the License or any later version.
% This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
% You should have received a copy of the GNU General Public License along with this program.  If not see .
%

function STATM = allstats(varargin)

Cr = varargin{1}; Cr = Cr(:);
Cf = varargin{2}; Cf = Cf(:);

%%% Check size:
if length(Cr) ~= length(Cf)
error(‘Cr and Cf must be of same length‘);
end

%%% Check NaNs:
iok = find(isnan(Cr)==0 & isnan(Cf)==0);
if length(iok) ~= length(Cr)
warning(‘Found NaNs in inputs removed them to compute statistics‘);
end
Cr  = Cr(iok);
Cf  = Cf(iok);
N   = length(Cr);

%%% STD:
st(1) = sqrt(sum(  (Cr-mean(Cr) ).^2)  / N );
st(2) = sqrt(sum(  (Cf-mean(Cf) ).^2)  / N );
%st(1) = sqrt(sum(  (Cr-mean(Cr) ).^2)  / (N-1) );
%st(2) = sqrt(sum(  (Cf-mean(Cf) 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-10 11:11  taylordiagram\
     文件      118803  2017-09-07 22:18  taylordiagram\Taylor Diagram Primer.pdf
     目录           0  2017-12-10 11:11  taylordiagram\__MACOSX\
     文件         186  2010-02-10 20:45  taylordiagram\__MACOSX\._taylordiag.m
     文件         186  2010-02-10 18:42  taylordiagram\__MACOSX\._taylordiag_test.m
     文件        3475  2017-09-05 11:20  taylordiagram\allstats.m
     文件        1314  2014-02-12 13:04  taylordiagram\license.txt
     文件        2698  2017-09-05 11:58  taylordiagram\ptable.m
     文件       17017  2017-09-06 15:40  taylordiagram\taylordiag.m
     文件       14984  2009-09-25 22:27  taylordiagram\taylordiag_egdata.mat
     文件        2890  2017-09-05 16:42  taylordiagram\taylordiag_test.asv
     文件        2899  2017-09-05 17:02  taylordiagram\taylordiag_test.m

评论

共有 条评论