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

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

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

                                        function: ARFIMA Fit
                                         功能:ARFIMA适合

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

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

Method for fitting an ARFIMA models.
装修的ARFIMA模型的方法。


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


arfimafit(spec, data, out.sample = 0, solver = "solnp", solver.control = list(),
fit.control = list(fixed.se = 0, scale = 0), ...)



参数----------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.
一个的ARFIMA规范对象的类ARFIMAspec。


参数:out.sample
A positive integer indicating the number of periods before  the last to keep for out of sample forecasting (see details).
一个正整数,表示前的最后期间保持了样本外预测(见详情)。


参数:solver
One of either “nlminb”, “solnp”, “gosolnp” or “nloptr”.
其中一个任一“nlminb”中,“solnp”,的的“gosolnp”或“nloptr”。


参数:solver.control
Control arguments list passed to optimizer.
控制参数列表传递给优化。


参数:fit.control
Control arguments passed to the fitting routine. The  fixed.se argument controls whether standard errors should be calculated for  those parameters which were fixed (through the fixed.pars argument of the  arfimaspec function). The scale parameter controls whether the data should be scaled before being submitted to the optimizer.
控制参数传递给装修程序。的参数控制标准误差是否应计算这些参数是固定的(通过论点的arfimaspec function). The scale parameter controls whether the data should be scaled before being submitted to the optimizer.“的fixed.pars的fixed.se


参数:...
.  



Details

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

The ARFIMA optimization routine first calculates a set of feasible starting  points which are used to initiate the ARFIMA Maximum Likelihood recursion. The  main part of the likelihood calculation is performed in C-code for speed.<br> The out.sample option is provided in order to carry out forecast performance  testing against actual data. A minimum of 5 data points are required for these  tests. If the out.sample option is positive, then the routine will fit only  N - out.sample (where N is the total data length) data points, leaving  out.sample points for forecasting and testing using the forecast performance  measures. In the arfimaforecast routine the  n.ahead may also  be greater than the out.sample number resulting in a  combination of out of sample data points matched against actual data and some  without, which the forecast performance tests will ignore.<br> The &ldquo;gosolnp&rdquo; solver allows for the initialization of multiple restarts  of the solnp solver with randomly generated parameters (see documentation in  the Rsolnp-package for details of the strategy used). The solver.control list  then accepts the following additional (to the solnp) arguments: &ldquo;n.restarts&rdquo;  is the number of solver restarts required (defaults to 1), &ldquo;parallel&rdquo; and  &ldquo;parallel.control&rdquo; for use of the parallel functionality, &ldquo;rseed&rdquo;  is the seed to initialize the random number generator, and &ldquo;n.sim&rdquo; is the  number of simulated parameter vectors to generate per n.restarts.
的的ARFIMA优化程序首先计算出了一套可行的出发点,这是用于启动ARFIMA最大似然递归。似然度计算的主要部分的C代码进行的速度。<br>该out.sample选项设置,以便进行测试的实际数据的预测性能。这些测试所需的最低的5个数据点。如果out.sample选项是正的,那么程序将适合:仅N  -  out.sample(其中N是总的数据长度)的数据点,用于预测和测试使用的预测性能的措施留下out.sample点。在arfimaforecast例程n.ahead也可以是更大的,比满分样本数据点的组合的实际数据和一些不相匹配,导致的out.sample数目的预测性能测试将忽略。<BR >“gosolnp”求解器可以初始化多个重新启动的solnp求解随机生成的参数(在Rsolnp包使用的策略的详细信息,请参阅文档)。该solver.control名单,然后接受下列额外的(solnp)参数:“n.restarts”是求解器重新启动需要使用(默认为1),“平行”和“parallel.control”平行的功能,“rseed”是初始化的随机数发生器的种子,并,“n.sim”是数字模拟的参数矢量,以产生每n.restarts。


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

A ARFIMAfit object containing details of the ARFIMA fit.
AARFIMAfit对象,详细介绍的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")

print(cfmatrix, digits = 4)
# notice that for the student distribution kurtosis is NA since shape (dof) &lt; 4.[请注意,对于学生分布峭度是不适用的,因为形状(DOF)4。]
cat("\nas.data.frame method:\n")
head(as.data.frame(fit[[1]]))
cat("\ncoef method:\n")
coef(fit[[1]])
cat("\nfitted method:\n")
head(fitted(fit[[1]]))
cat("\ninfocriteria method:\n")
infocriteria(fit[[1]])
cat("\nlikelihood method:\n")
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中,第一行是零,应该被丢弃)。]
head(residuals(fit[[1]]))
cat("\nuncmean method:\n")
uncmean(fit[[1]])
cat("\nuncmean method (by simulation):\n")
uncmean(fit[[1]], method = "simulation", n.sim = 100000, rseed = 100)
cat("\nsummary method:\n")
show(fit[[1]])

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

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-13 05:19 , Processed in 0.020920 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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