简体   繁体   English

R中的广义双曲分布

[英]Generalized hyperbolic distribution in R

如何使用包“广义双曲分布”来使NIG分布中的参数适合数据集?

Developing @Prasad Chalasani's comment, you need to install the ghyp package. 开发@Prasad Chalasani的评论,您需要安装ghyp软件包。 When I did, the packages gtools , gdata , numDeriv and gplots were also installed automatically. 完成后,软件包gtoolsgdatanumDerivgplots也会自动安装。 However, I then got the same error as you Error: could not find function "fit.NIGuv" , which I resolved by installing the bitops package manually. 但是,然后我得到了与您相同的错误: Error: could not find function "fit.NIGuv" ,我通过手动安装bitops软件包解决了该bitops

The documentation gives an example of the following code using fit.NIGuv() 文档提供了一个使用fit.NIGuv()的以下代码的示例。

library(ghyp)
data(smi.stocks)
nig.fit <- fit.NIGuv(smi.stocks[,"SMI"], opt.pars = c(alpha.bar = FALSE),
                     alpha.bar = 1, control = list(abs.tol = 1e-8))
nig.fit
summary(nig.fit)
hist(nig.fit)

where the output includes 输出包括

Asymmetric Normal Inverse Gaussian Distribution:

Parameters:
    alpha.bar            mu         sigma         gamma 
 1.0000000000  0.0008370731  0.0112098776 -0.0007205143 

log-likelihood:
5495.705

and I think this is the kind of thing you are looking for. 我想这就是您要寻找的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM