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 9123201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:16:54+00:00 2026-06-17T06:16:54+00:00

I am working with 30 days (monthly) per cycle and thus have approximately 2

  • 0

I am working with 30 days (monthly) per cycle and thus have approximately 2 cycles in my historical dataset.

R script is,

library(forecast)
value <- c(117.2 , 224.2 , 258.0 , 292.1 , 400.1 , 509.9 , 626.8 , 722.9 , 826.1 , 883.6,916.6, 1032.1, 1151.2, 1273.4 ,1391.8, 1499.2, 1532.5 ,1565.9 ,1690.9, 1813.6,1961.4 ,2102.8 ,2208.2, 2256.8, 2290.8 ,2413.7, 2569.4 ,2730.3, 2882.9 ,2977.5, 117.2 , 224.2 , 258.0 , 292.1 , 400.1 , 509.9 , 626.8 , 722.9 , 826.1 , 883.6,916.6, 1032.1, 1151.2, 1273.4 ,1391.8, 1499.2, 1532.5 ,1565.9 ,1690.9, 1813.6,1961.4 ,2102.8 ,2208.2, 2256.8, 2290.8 ,2413.7, 2569.4 ,2730.3, 2882.9 ,2977.5)

sensor<-ts(value,frequency=30)#daily data of month,here only 2 month's data
fit <- auto.arima(sensor)
LH.pred<-predict(fit,n.ahead=30)
plot(sensor,ylim=c(0,4000),xlim=c(0,5),type="o", lwd="1")
lines(LH.pred$pred,col="red",type="o",lwd="1")
grid()

The resulting graph is
prediction graph

But I am not satisfied with the prediction. Is there any way to make the prediction look similar to the value trends preceding it (see graph)?

  • 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-17T06:16:56+00:00Added an answer on June 17, 2026 at 6:16 am

    You are asking a lot of auto.arima() to find a model using only two months of data. At least help it out a little by suggesting a seasonal difference. Further, don’t use predict. The forecast function is much nicer.

    For reasons why forecast() is “nicer”, see the Journal of Statistical Software of July 2008, in particular section 4.4:

    The forecast() function is generic and has S3 methods for a wide range
    of time series models. It computes point forecasts and prediction
    intervals from the time series model. Methods exist for models fitted
    using ets(), auto.arima(), Arima(), arima(), ar(), HoltWinters() and
    StructTS().

    There is also a method for a ts object. If a time series
    object is passed as the first argument to forecast(), the function will
    produce forecasts based on the exponential smoothing algorithm of
    Section 2.

    In most cases, there is an existing predict() function
    which is intended to do much the same thing. Unfortunately, the
    resulting objects from the predict() function contain different
    information in each case and so it is not possible to build generic
    functions (such as plot() and summary()) for the results. So, instead,
    forecast() acts as a wrapper to predict(), and packages the
    information obtained in a common format (the forecast class). We also
    define a default predict() method which is used when no existing
    predict() function exists, and calls the relevant forecast() function.
    Thus, predict() methods parallel forecast() methods, but the latter
    provide consistent output that is more usable.

    Try the following.

    fit <- auto.arima(sensor,D=1)
    LH.pred <- forecast(fit,h=30)
    plot(LH.pred)
    grid()
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on this for days but I don't get it so
I have spent the past couple of days working on this and am going
I have daily time series (of working days) which I would like to transform
Suppose, I have this array in php $cities=array( Caracas=>array( air=>array( 4,3-5 Working Days,Saturday ),
I realise different solutions will have different variations of what Working Days means but
I have seen numerous posts related to adding working days (excluding weekends) to a
I have application that needs to be run on working days, and within working
I have been working 2 days on creating a simple exe COM server, I
I have trouble doing this. I'm creating a method that add working days on
I have spent days working on this and really feel dumb. I have been

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.