楼主: wljyxz
1308 3

[问答] R语言问题求指点 [推广有奖]

  • 0关注
  • 0粉丝

高中生

95%

还不是VIP/贵宾

-

威望
0
论坛币
396 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
221 点
帖子
14
精华
0
在线时间
48 小时
注册时间
2014-5-24
最后登录
2019-9-10

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我在做ARFIMA预测,请问如何提取其中的Forecasts的值,数据集是X
$`Mode 1`
$`Mode 1`$`Forecasts and SDs`
                      1           2
Forecasts   3.75038e-05 1.65357e-05
Exact SD    7.27002e-03 7.27177e-03
Limiting SD 7.27002e-03 7.27177e-03

求指点该怎么提取数据~~~~~~
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:R语言问题 R语言 求指点 forecasts Forecast 如何

沙发
Waterloo19 发表于 2015-9-21 08:46:47 |只看作者 |坛友微信交流群
predict().

for example:

set.seed(82365)
sim <- arfima.sim(1000, model = list(dfrac = 0.4, theta=0.9, dint = 1))
fit <- arfima(sim, order = c(0, 1, 1))
fit
pred <- predict(fit, n.ahead = 5)
pred
已有 1 人评分论坛币 收起 理由
admin_kefu + 20 热心帮助其他会员

总评分: 论坛币 + 20   查看全部评分

使用道具

藤椅
wljyxz 发表于 2015-9-22 07:42:50 |只看作者 |坛友微信交流群
Waterloo19 发表于 2015-9-21 08:46
predict().

for example:
麻烦能帮我看下R返回这个错误说明了什么?完全没看懂~
Error in arfima.sim(n.ahead, model = list(phi = phi, theta = theta, dint = dint,  :
  Model is non-causal, non-invertible or non-identifiable

使用道具

板凳
Waterloo19 发表于 2015-9-23 02:44:56 |只看作者 |坛友微信交流群
arfima.sim calls a function called IdentInvertQ that does some checking:

IdentInvertQ - Checks whether the model is identifiable, stationary, and invertible. Identifiability
is checked through the information matrix of all non-FGN components, as well as whether both
types of fractional noise are present, both seasonally and non-seasonally.

IdentInvertQ <-
function(phi = numeric(0), theta = numeric(0), phiseas = numeric(0), thetaseas = numeric(0), dfrac = numeric(0), dfs = numeric(0),
        H = numeric(0), Hs = numeric(0), alpha = numeric(0), alphas = numeric(0), delta = numeric(0), period = 0, debug = FALSE, ident = TRUE) {
        if(!(InvertibleQ(phi)&&InvertibleQ(theta)&&InvertibleQ(phiseas)&&InvertibleQ(thetaseas)&&InvertibleD(dfrac)&&InvertibleD(dfs)
                &&InvertibleH(H)&&InvertibleH(Hs)&&InvertibleQ(delta)&&InvertibleAlpha(alpha)&&InvertibleAlpha(alphas))) {
                if(debug) warning("Model is non-stationary or non-invertible")
                return(FALSE)
        }
        if((length(H)+length(dfrac)+length(alpha)>1)||(length(Hs)+length(dfs)+length(alphas)>1)) {
                if(debug) warning("Model is contains fractional d or H in either seasonal or non-seasonal components")
                return(FALSE)
        }
        if(ident&&(length(phi)>0||length(theta)>0||length(phiseas)>0||length(thetaseas)>0||length(dfrac)>0||length(dfs)>0)) {
                if(length(dfrac)>0) d <- T
                else d <- F
                if(length(dfs) >  0) dd <- T
                else dd <- F
                I <- iARFIMA(phi = phi, theta = theta, phiseas = phiseas, thetaseas = thetaseas, dfrac = d, dfs = dd, period = period)
                if(!recdet(I)) {
                        if(debug) warning("Information matrix of SARMA or ARFIMA process is not positive definite")
                        return(FALSE)
                }
        }
       
        TRUE
}

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-6-7 18:07