empcdf.m
来自「Modeling and Forecasting Electricity Loa」· M 代码 · 共 30 行
M
30 行
function [x0,y0] = empcdf(x,infsupport)
%EMPCDF Empirical cumulative distribution function (cdf).
% EMPCDF(X) plots the empirical cdf of the elements in vector X assuming
% that the support of the distribution is (-INF,MAX(X)].
% EMPCDF(X,INFSUPPORT) allows the user to specify the infimum of the
% support.
% [X0,Y0] = EMPCDF(X) does not draw a graph, but returns vectors X0 and
% Y0 such that PLOT(X0,Y0) is the empirical cdf.
%
% See also EMPDENS.
% Written by Rafal Weron (1999.09.15, rev. 2004.04.03)
% Copyright (c) 1999-2006 by Rafal Weron
if nargin == 0
error('Requires one input argument.')
end
if nargin < 2
infsupport = -inf;
end
x = x(:);
n = length(x);
x0 = sort([infsupport; x]);
y0 = (0:n)'/n;
if nargout == 0
plot(x0,y0);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?