gpt4 book ai didi

r - 如何从uGARCHfit(rugarch包)中提取AIC

转载 作者:行者123 更新时间:2023-12-04 12:06:24 24 4
gpt4 key购买 nike

我使用 rugarch 包安装了 egarch 模型,并想从拟合模型中提取 AIC。我怎么做?

我尝试了两个代码fittedmodel@fit$infocriteria[1]fittedmodel@fit$criteria[1]但它们都不起作用

egarchspec=ugarchspec(variance.model = list(model = "eGARCH", garchOrder = c(1,1)),distribution.model="sged")
fittedmodel<-ugarchfit(egarchspec, data=pregfc$RAU)
fittedmodel@fit$infocriteria[1]
结果为NULL。

最佳答案

我们可以使用 infocriteria

data(dmbp)
spec <- ugarchspec()
fit <- ugarchfit(data = dmbp[,1], spec = spec)

infocriteria(fit)
#
# Akaike 1.124508
# Bayes 1.141493
# Shibata 1.124490
# Hannan-Quinn 1.130749
infocriteria(fit)[1]
# [1] 1.124508

如果您希望更多地手动执行此操作或查看后面的公式,请参阅
getMethod("infocriteria", "uGARCHfit")

这导致
rugarch:::.information.test
# function (LLH, nObs, nPars)
# {
# AIC = (-2 * LLH)/nObs + 2 * nPars/nObs
# BIC = (-2 * LLH)/nObs + nPars * log(nObs)/nObs
# SIC = (-2 * LLH)/nObs + log((nObs + 2 * nPars)/nObs)
# HQIC = (-2 * LLH)/nObs + (2 * nPars * log(log(nObs)))/nObs
# informationTests = list(AIC = AIC, BIC = BIC, SIC = SIC,
# HQIC = HQIC)
# return(informationTests)
# }
# <bytecode: 0x10e316fc0>
# <environment: namespace:rugarch>

关于r - 如何从uGARCHfit(rugarch包)中提取AIC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54100629/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com