resid-futures(schwartz97)
resid-futures()所属R语言包:schwartz97
Extract Model Residuals
提取模型残差
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Function to extract model residuals from schwartz2f.fit-objects.
提取模型的残差schwartz2f.fit对象的功能。
用法----------Usage----------
## S4 method for signature 'schwartz2f.fit'
resid(object, data, ttm, type = c("filter", "filter.std", "real"))
参数----------Arguments----------
参数:object
A schwartz2f.fit-object returned from schwartz2f.fit.
返回schwartz2f.fitAschwartz2f.fit对象。
参数:data
A matrix with futures prices.
矩阵与期货价格。
参数:ttm
A matrix with the corresponding time to maturity (see Details).
一个矩阵,相应的到期时间(见详情)。
参数:type
What kind of residuals shall be returned (see Details).
什么样的残留物应归还(见详情)。
Details
详细信息----------Details----------
If type == "filter", then the residuals from the measurement equation are returned. If type == "filter.std", standardized residuals from the measurement equation are returned (note that these residuals should be standard multivariate normal). If type == "real", the difference between the observed futures prices and the fitted values (see fitted) are returned.
如果type == "filter",然后传回的测量方程的残差。如果type == "filter.std",标准化的测量方程的残差返回(注意,这些残留物应该是标准的多元正态分布)。如果type == "real",所观察到的期货价格和拟合值(见fitted)返回之间的差异。
The model and its parameters are described in the Details section of the schwartz2f-class documentation and in the package vignette Technical Document.
该模型及其参数的描述,在“详细信息”部分的schwartz2f级的文件和技术文件包中的小插曲。
值----------Value----------
A matrix containing the residuals.
一个矩阵包含的残差。
(作者)----------Author(s)----------
Philipp Erb, David Luethi, Juri Hinz
参见----------See Also----------
fit.schwartz2f, schwartz2f.fit-class, fitted.
fit.schwartz2f,schwartz2f.fit类fitted。
实例----------Examples----------
data(futures)
## Estimate parameters for live.cattle data.[#估计参数为live.cattle数据。]
## (little precision required with reltol = 1e-3)[#(小,精度要求与RELTOL = 1E-3)]
fit.obj <- fit.schwartz2f(futures$live.cattle$price, futures$live.cattle$ttm / 260,
deltat = 1 / 260,
control = list(maxit = 100, reltol = 1e-3))
## Standardized residuals [#标准化残差]
resid.std <- resid(fit.obj, data = futures$live.cattle$price, ttm =
futures$live.cattle$ttm / 260, type = "filter.std")
acf(resid.std, na.action = na.pass) # ...are not independent[...是不是独立]
## Real differences[#真正的差异]
resid.real <- resid(fit.obj, data = futures$live.cattle$price, ttm =
futures$live.cattle$ttm / 260, type = "real")
plot(as.ts(resid.real / futures$live.cattle$price)) # ...are 'relatively' accurate.[...是“相对”准确的。]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|