1 Star 3 Fork 0

mcgradytien / enkf-matlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
calc_bestrmse.m 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
106559363@qq.com 提交于 2017-02-15 16:00 . add matlab code
% function [rmse] = calc_bestrmse(x, E)
% Calculates the best possible RMSE for a given true field and ensemble
%
% @param x - true field (n x 1)
% @param E - ensemble (n x m)
% @return rmse - RMSE value
% File: calc_bestrmse.m
%
% Created: 31/08/2007
%
% Last modified: 08/02/2008
%
% Author: Pavel Sakov
% CSIRO Marine and Atmospheric Research
%
% Purpose: Calculates the best possible RMSE for a given true field and
% ensemble
%
% Description: Solves E * s = x in the least squares sense;
% then xbest = E * s.
%
% Revisions:
%% Copyright (C) 2008 Pavel Sakov
%%
%% This file is part of EnKF-Matlab. EnKF-Matlab is a free software. See
%% LICENSE for details.
function [rmse] = calc_bestrmse(x, E)
[n, m] = size(E);
if n > 1000
rmse = 0;
return ;
end
c = rcond(E * E');
if c > 1.0e-6
s = inv(E' * E) * E' * x;
else
warning off;
s = lscov(E, x);
warning on;
end
xbest = E * s;
rmse = std(xbest - x, 1);
return
Matlab
1
https://gitee.com/mcgradytien_admin/enkf-matlab.git
git@gitee.com:mcgradytien_admin/enkf-matlab.git
mcgradytien_admin
enkf-matlab
enkf-matlab
master

搜索帮助