Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:52:47+00:00 2026-06-09T01:52:47+00:00

In R after calibrating in sample the coefficient for an ARMA model, how can

  • 0

In R after calibrating in sample the coefficient for an ARMA model, how can I generate the error which would result of using the same coefficients on another set, out-of-sample, of data ?

Let’s say that insamp contains my in sample series, I calibrate an ARMA(5,2) by typing:

    det_fit = arima(insamp , c(5,0,2));

Now I want to compute the error on the outsamp series (I divided arbitrarily the series in two halves insamp and outsamp).

If the model was an AR(5), this is what I did:

    detrended_outsamp_forecast_ts = det_fit$coef["intercept"] + 
    det_fit$coef["ar1"] * c(rep(NA,1), outsamp)  + 
    det_fit$coef["ar2"] * c(rep(NA,2), outsamp) +
    det_fit$coef["ar3"] * c(rep(NA,3), outsamp) +
    det_fit$coef["ar4"] * c(rep(NA,4), outsamp) +
    det_fit$coef["ar5"] * c(rep(NA,5), outsamp);

Which is very long and not generic.

Is there anybody who wrote a function to apply the ARMA coefficients on an arbitrary time-series ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:52:49+00:00Added an answer on June 9, 2026 at 1:52 am
    library(forecast)
    det_fit <- Arima(insamp, order=c(5,0,2))
    new_fit <- Arima(outsamp, model=det_fit)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After following the RoR getting started tutorial, I added another model as: $ rails
After doing an AJAX call, am redirecting- using the following code. But, after AJAX
After figuring out (via SO, of course) that the error for a bad $ftp
After following: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview I can sign up a user via Facebook. But I'm struggling
After using Instruments, I have found the a spot in my code that is
After constructing the bean, I want to retrieve data from the database, using the
After successfully compiling a Python/C binding with SIP I wanted to do the same
After using the following code no errors are shown, but my database is not
After reading lots of sample code into this matter, I'm trying to figure out
After a relatively easy coast to simple app coding, I would like to understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.