Last active
          December 26, 2015 13:49 
        
      - 
      
- 
        Save qoelet/7161498 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require(fArma) | |
| # assumes data is already a ts object | |
| i = diff(data) | |
| z = data[1] | |
| m = mean(i) | |
| n = length(data) | |
| k = 3 | |
| fit = armaFit(~ arma(1,1), data=i) | |
| pred = predict(fit, k) | |
| forecast = ((n + k) * m) + z | |
| print(forecast) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment