【FinE】Generalized Hyperbolic(GH)函数/SGT函数及Toolbox的使用

Generalized Hyperbolic

This toolbox contains necessary tools related to the skewed generalized t(SGT) and the generalized hyperbolic (GH) distributions. Distribution fitting is also included.

Toolbox实现函数如下

函数文件函数接口附注
ghcdf.mp=ghcdf(x, Param, m, sigma)Generalized Hyperbolic cumulative density function (cdf)
ghfit.m[parmhat, se, parmci, output]=ghfit(X, alpha, flag)PARMHAT=ghfit(X)返回描述GH的最大似然估计,LAMBDA=PARMHAT(1)为尾部指数参数, ZETA=PARMHAT(2)为形状参数,RHO=PARMHAT(3)为偏度参数;SE返回估计的标准误差;PARMCI返回参数估计的95%置信区间;OUTPUT返回结构化的输出包括拟合的偏度和峰度以及MLE; […]=GITFIT(X, ALPHA) 返回100(1-ALPHA) percent 参数估计的C.I.;FLAG=1进一步给出估计的均值和标准差,PARMHAT(4)为均值,PARMHAT(5)为标准差
ghpdf.my=ghpdf(x, param, m, sigma)GH函数的pdf

ghcdf

计算GH分布的累计概率密度函数(cdf),根据传入参数Param, m, sigma计算在x处的值

%% GHCDF计算
% 使用 Flexible distributions toolbox计算
X = returns(:, 1);
[parmhat, se, parmci, output] = ghfit(X, 0.05, 1);

p = ghcdf(0.001, parmhat(1:3));

RHO>0表示GHD为右偏,RHO<0表示GHD为左偏

ghfit

使用GH分布拟合序列,在设置FLAG=1的情况下可以得到拟合的偏度(skewness)和峰度(kurtosis)

[parmhat, se, parmci, output] = ghfit(X, 0.05, 1);

ghpdf

GH分布的pdf函数,当 ζ → ∞ \zeta\to\infty ζ ϱ = 0 \varrho=0 ϱ=0时,GH概率密度函数变为normal distribution,当 ϱ < 0 \varrho<0 ϱ<0GH分布呈现左偏的形状,当 ϱ > 0 \varrho>0 ϱ>0GH分布呈现右偏的形状
在这里插入图片描述

ghpdf(x, Param, m, sigma)给出在点x处的pdf值,拟合收益率序列如下图所示

% 拟合分布
sample_ret = returns(:, 1);
xmin = min(sample_ret)-0.01;
xmax = max(sample_ret)+0.01;

xp = xmin: 0.01:xmax;
[parmhat, se]=ghfit(sample_ret);
x_mean = mean(sample_ret); % 一阶矩信息
x_sigma = std(sample_ret); % 二阶矩信息

yp = ghpdf(xp, parmhat, x_mean, x_sigma);

hold on;
yyaxis left; % 激活左轴
plot(xp, yp, 'b--');

yyaxis right; % 激活右轴
histogram(X, 'Normalization', 'probability', 'FaceAlpha', 0.4);
legend('GH-fitted', 'returns');
hold off;

GH

Skew Generalized t

SGT(skew generalized t)是一种五参数分布,pdf如下
sgt

形状参数 η > 0 , ψ > 2 \eta>0, \psi>2 η>0,ψ>2,偏度参数 ∣ λ ∣ < 1 |\lambda|<1 λ<1 B ( ⋅ ) B(\cdot) B() β \beta β函数, s g n ( ⋅ ) sgn(\cdot) sgn()为符号函数, μ \mu μ为位置参数, θ \theta θ为正则化因子,使得 V ( x ) = σ 2 \mathbb{V}(x)=\sigma^2 V(x)=σ2

sgtcdf

返回在x点处的累计概率密度

p = sgtcdf(x, Param, m, sigma)

sgtfit

% sgtfit parameter estimates and confidence intervals for skewed generalized t data
% 其余和GH类似

sgtinv

计算Inverse of skewed generalized T cumulative density functionCDF

sgtpdf

SGT分布对数据进行拟合,当 η = 2 \eta=2 η=2时,函数成为standardized student's t-distribution with d.o.f ψ. 当 ψ = ∞ \psi=\infty ψ=函数变为GED(η). 当 η = 2 , ψ = ∞ \eta=2,\psi=\infty η=2,ψ=时,SGT变为skew normal.

%% SGTCDF计算
[sgt_p, se]=sgtfit(sample_ret);
yp = sgtpdf(xp, sgt_p, x_mean, x_sigma);

hold on;
yyaxis left; 
plot(xp, yp, 'b--');

yyaxis right;
histogram(sample_ret, 'Normalization', 'probability', 'FaceAlpha', 0.4);
legend('SGT-fitted', 'returns');

hold off;

sgt

sgtrnd

Skewed Generalized T分布中进行抽样

skewtfit

Skewd Distributions:Fernandez and Steel(1998) proposed a quite general approach that allows the introduction of skewness in any continuous unimodal and symmetric distribution by changing the scale at each side of the mode

f ( z ∣ ξ ) = 2 ξ + 1 ξ [ f ( ξ z ) H ( − z ) + f ( z ξ ) H ( z ) ] f(z\mid \xi)=\frac{2}{\xi+\frac{1}{\xi}}[f(\xi_z)H(-z)+f(\frac{z}{\xi})H(z)] f(zξ)=ξ+ξ12[f(ξz)H(z)+f(ξz)H(z)]
其中 0 < ξ < ∞ 0<\xi<\infty 0<ξ<为形状参数,描述函数的非对称性程度, ξ = 1 \xi=1 ξ=1为对称分布, f ( z ∣ ξ = 1 ) = f ( z ) f(z\mid\xi=1)=f(z) f(zξ=1)=f(z).
H ( z ) = ( 1 + s g n ( z ) ) / 2 H(z)=(1+sgn(z))/2 H(z)=(1+sgn(z))/2Heaviside unit step funciton.

[parmhat, se, parmci, output]=skewtfit(X, alpha, flag)

SGT

References

Flexible distributions toolbox
Highly flexible distributions to fit multiple frequency financial returns

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
很实用的时频分析工具箱,包括短时傅里叶正反变换等,很好,很强大哦~~分享给大家,包括以下函数的源代码: % sigmerge - Add two signals with given energy ratio in dB. % % Choice of the Instantaneous Amplitude % amexpo1s - Generate one-sided exponential amplitude modulation. % amexpo2s - Generate bilateral exponential amplitude modulation. % amgauss - Generate gaussian amplitude modulation. % amrect - Generate rectangular amplitude modulation. % amtriang - Generate triangular amplitude modulation. % % Choice of the Instantaneous Frequency % fmconst - Signal with constant frequency modulation. % fmhyp - Signal with hyperbolic frequency modulation. % fmlin - Signal with linear frequency modulation. % fmodany - Signal with arbitrary frequency modulation. % fmpar - Signal with parabolic frequency modulation. % fmpower - Signal with power-law frequency modulation. % fmsin - Signal with sinusoidal frequency modulation. % gdpower - Signal with a power-law group delay. % % Choice of Particular Signals % altes - Altes signal in time domain. % anaask - Amplitude Shift Keyed (ASK) signal. % anabpsk - Binary Phase Shift Keyed (BPSK) signal. % anafsk - Frequency Shift Keyed (FSK) signal. % anapulse - Analytic projection of unit amplitude impulse signal. % anaqpsk - Quaternary Phase Shift Keyed (QPSK) signal. % anasing - Lipschitz singularity. % anastep - Analytic projection of unit step signal. % atoms - Linear combination of elementary Gaussian wave packets. % dopnoise - Generate complex Doppler random signal. % doppler - Generate complex Doppler signal. % klauder - Klauder wavelet in time domain. % mexhat - Mexican hat wavelet in time domain. % tftb_window - Window generation (previously window.m). % % Addition of Noise % noisecg - Analytic complex gaussian noise. % noisecu - Analytic complex uniform noise. % % Modification % scale - Scale signal using Mellin transform. % % % Processing Files % % Time-Domain Processing % ifestar2 - Instantaneous frequency estimation using AR2 modelisation. % instfreq - Instantaneous frequency estimation. % loctime - Time localization characteristics. % % Frequency-Domain Processing % fmt - Fast Mellin transform % ifmt - Inverse fast Mellin transform. % locfreq - Frequency localization characteristics. % sgrpdlay - Group delay estimation. % % Linear Time-Frequency Processing % tfrgabor - Gabor representation. % tfrstft - Short time Fourier transform. % % Bilinear Time-Frequency Processing in the Cohen's Class % tfrbj - Born-Jordan distribution. % tfrbud - Butterworth distribution. % tfrcw - Choi-Williams distribution. % tfrgrd - Generalized rectangular distribution. % tfrmh - Margenau-Hill distribution. % tfrmhs - Margenau-Hill-Spectrogram distribution. % tfrmmce - MMCE combination of spectrograms. % tfrpage - Page distribution. % tfrpmh - Pseudo Margenau-Hill distribution. % tfrppage - Pseudo Page distribution. % tfrpwv - Pseudo Wigner-Ville distribution. % tfrri - Rihaczek distribution. % tfrridb - Reduced interference distribution (Bessel window). % tfrridh - Reduced interference distribution (Hanning window). % tfrridn - Reduced interference distribution (binomial window). % tfrridt - Reduced interference distribution (triangular window). % tfrsp - Spectrogram. % tfrspwv - Smoothed Pseudo Wigner-Ville distribution. % tfrwv - Wigner-Ville distribution. % tfrzam - Zhao-Atlas-Marks distribution. % % Bilinear Time-Frequency Processing in the Affine Class % tfrbert - Unitary Bertrand distribution. % tfrdfla - D-Flandrin distribution. % tfrscalo - Scalogram, for Morlet or Mexican hat wavelet. % tfrspaw - Smoothed Pseudo Affine Wigner distributions. % tfrunter - Unterberger distribution, active or passive form. % % Reassigned Time-Frequency Processing % tfrrgab - Reassigned Gabor spectrogram. % tfrrmsc - Reassigned Morlet Scalogram time-frequency distribution. % tfrrpmh - Reassigned Pseudo Margenau-Hill distribution. % tfrrppag - Reassigned Pseudo Page distribution. % tfrrpwv - Reassigned Pseudo Wigner-Ville distribution. % tfrrsp - Reassigned Spectrogram. % tfrrspwv - Reassigned Smoothed Pseudo WV distribution. % % Ambiguity Functions % ambifunb - Narrow band ambiguity function. % ambifuwb - Wide band ambiguity function. % % Post-Processing or Help to the Interpretation % friedman - Instantaneous frequency density. % holder - Estimate the Holder exponent through an affine TFR. % htl - Hough transform for detection of lines in images. % margtfr - Marginals and energy of a time-frequency representation. % midscomp - Mid-point construction used in the interference diagram. % momftfr - Frequency moments of a time-frequency representation. % momttfr - Time moments of a time-frequency representation. % plotsid - Schematic interference diagram of FM signals. % renyi - Measure Renyi information. % ridges - Extraction of ridges. % tfrideal - Ideal TFR for given frequency laws. % % Visualization & backup % plotifl - Plot normalized instantaneous frequency laws. % tfrqview - Quick visualization of time-frequency representations. % tfrview - Visualization of time-frequency representations. % tfrparam - Return the paramaters needed to display (or save) a TFR. % tfrsave - Save the parameters of a time-frequency representation. % % % Other % disprog - Display progression of a loop. % divider - Find dividers of integer such that product equals integer. % dwindow - Derive a window. % integ - Approximate integral. % integ2d - Approximate 2-D integral. % izak - Inverse Zak transform. % istfr1 - returns true if a distribution is Cohen's class type 1 (spectrogram) % istfr2 - returns true if a distribution is Cohen's class type 2 (Wigner-Ville) % istfraff - returns true is a distribution is an affine class member % kaytth - Kay-Tretter filter computation. % modulo - Congruence of a vector. % movcw4at - Four atoms rotating, analyzed by the Choi-Williams distribution. % movpwdph - Influence of a phase-shift on the interferences of the pWVD. % movpwjph - Influence of a jump of phase on the interferences of the pWVD. % movsc2wv - Movie illustrating the passage from the scalogram to the WVD. % movsp2wv - Movie illustrating the passage from the spectrogram to the WVD. % movwv2at - Oscillating structure of the interferences of the WVD. % odd - Round towards nearest odd value. % sigmerge - Add two signals with given energy ratio in dB. % zak - Zak transform. % griffitc - Test signal example C of Griffiths' paper. % lambdak - Evaluate lambda function for Affine Wigner distribution. % umaxbert - Determination of the maximum value of u for Bertrand distribution. % umaxdfla - Determination of the maximum value of u for D-Flandrin distribution. % umaxunte - Determination of the maximum value of u for Unterberger distribution.
数论与特殊函数(英文版) 作者:吴振斌 著 出版时间:2011年版 内容简介   the purpose of this book is two-fold.firstly, it gives some basics of complex function theory andspecial functions and secondly, it assembles most important resultsin my own research made in the last several years under theguidance of professor s. kanemitsu, known as jin guangzi in china.the author would like to thank mr. y. -l. lu for helping withtypesetting. thus a beginner reader can use this book as a quick introductionto complex analysis and special functions, and an advanced readercan use it as a source book of many research problems. e.g. in thestudy of the euler integral which appeared in a generalization ofjensen's formula, there are possible new results obtained,likewisethe study of catalan's constant and kummer's fourier series wouldbe a rich arsenal for future studies. 目录 Preface Chapter 1 A quick introduction to complex analysis 1.1 Introduction 1.2 A quick introduction to complex analysis 1.2.1 Complex number system 1.2.2 Cauchy-Riemann equation and inverse functions 1.2.3 A rough description of complex analysis 1.2.4 Power series 1.2.5 Laurent expansion, residues 1.3 Around Jensen's formula 1.4 Partial fraction expansion 1.4.1 Partial fraction expansions for rational functions 1.4.2 Partial fraction expansion for the cotangent function and so its applications Chapter 2 Elaboration of results of Srivastava and Choi 2.1 Glossary of symbols and formulas 2.2 Around the Hurwitz zeta-function 2.2.1 Applications of Proposition 2.1 2.2.2 Applications of Corollary 2.1 2.3 Euler integrals 2.4 Around the Euler integral 2.5 Around the Catalan constant 2.6 Kummer's Fourier series for the Log Gamma function Chapter 3 Arithmetic Laurent coefficients 3.1 Introduction 3.2 Proof of results 3.3 Examples 3.4 The Piltz divisor problem 3.5 The partial integral Ik(x) 3.6 Generalized Euler constants and modular relation Chapter 4 Mikolas results and their applications 4.1 From the Riemann zeta to the Hurwitz zeta 4.2 Introduction and

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

minuxAE

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值