⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 empcdf.m

📁 Modeling and Forecasting Electricity Loads and Prices: A Statistical Approach" by Rafa&#322 Weron, p
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -