找回密码
 注册
查看: 321|回复: 0

R语言 rugarch包 arfimafilter-methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-28 23:32:13 | 显示全部楼层 |阅读模式
arfimafilter-methods(rugarch)
arfimafilter-methods()所属R语言包:rugarch

                                        function: ARFIMA Filtering
                                         功能:ARFIMA过滤

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Method for filtering an ARFIMA model.
过滤ARFIMA模型的方法。


用法----------Usage----------


arfimafilter(spec, data, out.sample = 0, n.old=NULL, ...)



参数----------Arguments----------

参数:data
A univariate data object. Can be a numeric vector, matrix,  data.frame, zoo, xts, timeSeries, ts or irts object.
一元数据对象。可以是一个数值向量,矩阵,数据框,动物园,XTS,时间序列,TS或IRTS对象。


参数:spec
An ARFIMA spec object of class ARFIMAspec  with the fixed.pars argument having the model parameters on which the filtering  is to take place.
一个的ARFIMA规范对象的类ARFIMAspec的模型参数的过滤是发生在fixed.pars参数。


参数:out.sample
A positive integer indicating the number of periods before  the last to keep for out of sample forecasting (as in arfimafit  function).
一个正整数,表示前的最后期间保持了样本外预测(如在arfimafit功能)。


参数:n.old
For comparison with ARFIMA models using the out.sample argument, this is the length of the original dataset (see details).
对于用ARFIMA模型使用out.sample参数比较,这是原始数据集的长度(见详情)。


参数:...
.  



Details

详细信息----------Details----------

The n.old argument is optional and indicates the length of the original data (in cases when this represents a dataseries augmented by newer data). The reason for using this is so that the old and new datasets agree since the original  recursion uses the sum of the residuals to start the recursion and therefore is  influenced by new data. For a small augmentation the values converge after x  periods, but it is sometimes preferable to have this option so that there is no  forward looking information contaminating the study.
n.old参数是可选的,表示的原始数据的长度(的情况下,当这代表了一个较新的数据增强dataseries)。使用这一点的原因是,使旧的和新的数据集的同意,因为原来的递归使用启动递归的残差的总和,因此,由新的数据的影响。对于一个小的增强后的值收敛X时期,但它有时是最好有此选项,以便有没有污染研究的前瞻性信息。


值----------Value----------

A ARFIMAfilter object containing details of the ARFIMA  filter.
AARFIMAfilter对象包含详细信息的ARFIMA过滤器。


(作者)----------Author(s)----------


Alexios Ghalanos



实例----------Examples----------


## Not run: [#不运行:]
data(sp500ret)       
fit = vector(mode = "list", length = 9)
dist = c("norm", "snorm", "std", "sstd", "ged", "sged", "nig", "ghyp", "jsu")
for(i in 1:9){
        spec = arfimaspec(mean.model = list(armaOrder = c(1,1), include.mean = TRUE,
        arfima = FALSE), distribution.model = dist[i])
        fit[[i]] = arfimafit(spec = spec, data = sp500ret, solver = "solnp",
        fit.control = list(scale = 1))
}
cfmatrix = matrix(NA, nrow = 9, ncol = 7)
colnames(cfmatrix) = c("mu", "ar1", "ma1", "sigma", "skew", "shape", "ghlambda")
rownames(cfmatrix) = dist

for(i in 1:9){
        cf = coef(fit[[i]])
        cfmatrix[i, match(names(cf), colnames(cfmatrix))] =  cf
}
sk = ku = rep(0, 9)
for(i in 1:9){
        cf = coef(fit[[i]])
        if(fit[[i]]@model$modelinc[16]>0) sk[i] = dskewness(distribution = dist[i],
                                skew = cf["skew"], shape = cf["shape"], lambda = cf["ghlambda"])               
        if(fit[[i]]@model$modelinc[17]>0) ku[i] = dkurtosis(distribution = dist[i],
                                skew = cf["skew"], shape = cf["shape"], lambda = cf["ghlambda"])
}
hq = sapply(fit, FUN = function(x) infocriteria(x)[4])
cfmatrix = cbind(cfmatrix, sk, ku, hq)
colnames(cfmatrix)=c(colnames(cfmatrix[,1:7]), "skewness", "ex.kurtosis","HQIC")


# filter the data to check results[对数据进行筛选,检查结果]
filt = vector(mode = "list", length = 9)
for(i in 1:9){
        spec = arfimaspec(mean.model = list(armaOrder = c(1,1), include.mean = TRUE,
        arfima = FALSE), distribution.model = dist[i])
        setfixed(spec) = as.list(coef(fit[[i]]))
        filt[[i]] = arfimafilter(spec = spec, data = sp500ret)
}
print(cfmatrix, digits = 4)
cat("\nARFIMAfit and ARFIMAfilter residuals check:\n")
print(head(sapply(filt, FUN = function(x) residuals(x))) == head(sapply(fit,
FUN = function(x) residuals(x))))
cat("\nas.data.frame method:\n")
print(cbind(head(as.data.frame(filt[[1]])), head(as.data.frame(fit[[1]]))))
cat("\ncoef method:\n")
print(cbind(coef(filt[[1]]), coef(fit[[1]])))
cat("\nfitted method:\n")
print(cbind(head(fitted(filt[[1]])), head(fitted(fit[[1]]))))
cat("\ninfocriteria method:\n")
# For filter, it assumes estimation of parameters else does not make sense![的过滤器,它假定估计的参数,否则就没有意义!]
print(cbind(infocriteria(filt[[1]]), infocriteria(fit[[1]])))
cat("\nlikelihood method:\n")
print(cbind(likelihood(filt[[1]]), likelihood(fit[[1]])))
cat("\nresiduals method:\n")
# Note that we the package will always return the full length residuals and [需要注意的是,我们的包将总是返回全长残差]
# fitted object irrespective of the lags (i.e. since this is an ARMA(1,1) [嵌合对象无关的滞后(即,因为这是为ARMA(1,1)]
# i.e. max lag = 1, the first row is zero and should be discarded.[即最大滞后= 1时,第一行是零,并应被丢弃。]
print(cbind(head(residuals(filt[[1]])), head(residuals(fit[[1]]))))
cat("\nuncmean method:\n")
print(cbind(uncmean(filt[[1]]), uncmean(fit[[1]])))
cat("\nuncmean method (by simulation):\n")
# For spec and fit[为了规范和合适的]
spec = arfimaspec( mean.model = list(armaOrder = c(1,1), include.mean = TRUE,
arfima = FALSE), distribution.model = dist[1])
setfixed(spec) = as.list(coef(fit[[1]]))
print(cbind(uncmean(spec, method = "simulation", n.sim = 100000, rseed = 100),
uncmean(fit[[1]], method = "simulation", n.sim = 100000, rseed = 100)))
cat("\nsummary method:\n")
show(filt[[1]])
show(fit[[1]])

## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-28 06:36 , Processed in 0.024423 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表