R의 재귀 ARIMA 회귀

pkpkPPkafa

재귀 ARIMA 회귀를 수행하고 있습니다. 나는 내가 올바른 길이라고 생각하지만 (아래 코드 참조) 계수를 벡터에 넣을 때 문제가 있습니다. 간단히 말해, 계수는 모두 동일하지만는 달라야합니다.

rolling.arima <- lapply(seq(72,nrow(udb)), 
function(x) arima(udb.train,
order = c(1,1,0), seasonal = list(order = c(1,0,0), period = 12)))

all_slopes1 <- unlist(sapply(1:42, function(j) rolling.arima[[j]]$coef[1]))
all_slopes2 <- unlist(sapply(1:42, function(j) rolling.arima[[j]]$coef[2]))

plot.ts(all_slopes1)
plot.ts(all_slopes2)

문제를 발견 할 수있는 사람이 있습니까?

로버트

주석에서 언급했듯이 모든 창에서 데이터를 업데이트해야합니다. 다음과 같이 시도하십시오.

rolling.arima <- lapply(seq(72,length(udb.train)), 
                        function(x) arima(udb.train[1:x],
                                          order = c(1,1,0), seasonal = list(order = c(1,0,0), period = 12)))
lrest<-length(rolling.arima)

all_slopes1 <- unlist(sapply(1:lrest, function(j) rolling.arima[[j]]$coef[1]))
all_slopes2 <- unlist(sapply(1:lrest, function(j) rolling.arima[[j]]$coef[2]))

plot.ts(all_slopes1)
plot.ts(all_slopes2)

여기에 이미지 설명 입력

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사