R/predARMA.R

Defines functions predARMA

Documented in predARMA

predARMA <- function(X,a){
  n<-length(X)
  pred<-c(1:n)
  pred[1:3]<-X[1:3]
  for(i in 4:n){
    pred[i]<-a[1]*X[i-1]+a[2]*X[i-2]+a[3]*X[i-3]
  }
  return(pred)
}

Try the mistat package in your browser

Any scripts or data that you put into this service are public.

mistat documentation built on March 7, 2023, 6:43 p.m.