hyppdf.m

来自「Modeling and Forecasting Electricity Loa」· M 代码 · 共 26 行

M
26
字号
function y=hyppdf(x,alpha,beta,delta,mu);
%HYPPDF Hyperbolic probability density function (pdf).
%   Y=HYPPDF(X,ALPHA,BETA,DELTA,MU) returns the pdf of the hyperbolic 
%   distribution with shape parameter ALPHA, skewness parameter BETA, 
%   scale parameter DELTA and location parameter MU, evaluated at the 
%   values in X.
%
%   Reference(s):
%	[1] R.Weron (2004) "Computationally intensive Value at Risk 
%   calculations", in "Handbook of Computational Statistics: Concepts and 
%   Methods", eds. J.E. Gentle, W. Haerdle, Y. Mori, Springer, Berlin, 
%   911-950. 
%   [2] R.Weron (2007) "Modeling and Forecasting Electricity Loads and 
%   Prices: A Statistical Approach", Wiley, Chichester.   

%   Written by Adam Misiorek and Rafal Weron (2006.09.22)
%   Copyright (c) 2006 by Rafal Weron

% Set lambda of the generalized hyperbolic distribution to 1
lambda = 1;
if (delta>0)&(alpha>abs(beta))
    kappa = (alpha^2-beta^2)^(lambda/2)/(sqrt(2*pi)*alpha^(lambda-1/2)*delta^lambda*besselk(lambda,delta*sqrt(alpha^2-beta^2)));
    y = kappa*(delta^2+(x-mu).^2).^((lambda-1/2)/2).*besselk(lambda-1/2,alpha*sqrt(delta^2+(x-mu).^2)).*exp(beta*(x-mu));
else
    y = Inf*ones(size(x));
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?