distribution.factorsEstEval(tsfa)
distribution.factorsEstEval()所属R语言包:tsfa
Distribution of Time Series Factors Estimates
分布时间序列的因素估计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Plot the distribution of the multiple estimates from EstEval, and possibly multiple EstEval objects.
画出分布的多个估算从EstEval,和可能有多个EstEval对象。
用法----------Usage----------
## S3 method for class 'factorsEstEval'
distribution(obj, ..., bandwidth = "nrd0",
cumulate=TRUE, graphs.per.page = 5, Title=NULL)
参数----------Arguments----------
参数:obj
EstEval object.
EstEval对象。
参数:bandwidth
bandwidth for distribution smoothing.
分布平滑的带宽。
参数:cumulate
logical indicating if the distribution across time and repititions should be plotted (TRUE) or a time series of standard deviation across repititions should be plotted (FALSE).
逻辑指示如果跨越时间和repititions的分布应绘制(TRUE),或跨repititions标准偏差的时间序列应绘制(FALSE)。
参数:graphs.per.page
number of graphs on an output page.
输出页上的图形。
参数:Title
string indicating a title for the plot.
字符串,表示一个标题为图。
参数:...
additional EstEval objects which will be plotted on the same graph.
的额外EstEval对象将被绘制在同一图形上。
(作者)----------Author(s)----------
Paul Gilbert
参见----------See Also----------
distribution, EstEval, estTSF.ML
distribution,EstEval,estTSF.ML
实例----------Examples----------
if (require("CDNmoney")){
data("CanadianMoneyData.asof.6Feb2004", package="CDNmoney")
### Construct data[##构造数据]
cpi <- 100 * M1total / M1real
seriesNames(cpi) <- "CPI"
popm <- M1total / M1PerCapita
seriesNames(popm) <- "Population of Canada"
z <- tframed(tbind(
MB2001,
MB486 + MB452 + MB453 ,
NonbankCheq,
MB472 + MB473 + MB487p,
MB475,
NonbankNonCheq + MB454 + NonbankTerm + MB2046 + MB2047 + MB2048 +
MB2057 + MB2058 + MB482),
names=c("currency", "personal cheq.", "NonbankCheq",
"N-P demand & notice", "N-P term", "Investment")
)
z <- tfwindow(z, start=c(1986,1))
if( all(c(2003,12) ==end(z))) z <-tfwindow(z, end=c(2003,11))
MBcomponents <- 1e8 * z/matrix(tfwindow(popm * cpi,tf=tframe(z)), Tobs(z),6)
### Specify "true" parameters and factors[##指定“true”参数和因素]
Omega <- diag(c(72.63, 1233, 87.33,
629.4, 3968, 12163))
Boblq <- t(matrix(c(
8.84, 5.20,
23.82, -12.57,
5.18, -1.97,
36.78, 16.94,
-2.84, 31.02,
2.60, 47.63), 2,6))
PhiOblq <- matrix(c( 1.0, 0.00949, 0.00949, 1.0),2,2)
etaBart <- MBcomponents %*% solve(Omega) %*% Boblq %*% (
solve( t(Boblq) %*% solve(Omega) %*% Boblq ) )
DetaBart <- diff(etaBart, lag=1)
SDE <- cov(DetaBart)
RR1 <- chol(SDE) # upper triangular: SDE = RR1' RR1[上三角:SDE = RR1RR1]
RR2 <- chol(PhiOblq) # ditto[同上]
PP <- t(RR2) %*% solve(t(RR1))
Psi <- 0.5 * Omega
etaTrue <- tframed(etaBart %*% t(PP), tf=tframe(MBcomponents))
### run Monte Carlo N.B. replications would typically be much larger[##运行蒙特卡洛注意:复制通常会大得多]
require("EvalEst")
EE.ML5 <- EstEval(TSFmodel(Boblq, f=etaTrue, positive.measures=FALSE),
replications=5, quiet=FALSE,
simulation.args=list(Cov=Psi, noIC=TRUE),
estimation="estTSF.ML", estimation.args=list(2, BpermuteTarget=Boblq),
criterion ="TSFmodel")
distribution(factors(EE.ML5))
distribution(factors(EE.ML5), cumulate=FALSE)
distribution(diff(factors(EE.ML5)))
distribution(diff(factors(EE.ML5)), cumulate=FALSE)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|