Analysis of Time Series data The Next CEO of Stack Overflow2019 Community Moderator ElectionTime series prediction using ARIMA vs LSTMTime Series Analysis in RForecasting non-negative sparse time-series dataForecasting one time series with missing data with help of other time seriesWhat are the prerequisites before running Holt Winters Model?Continuously predicting eventsTime series forecasting using multiple time series as training datademand forecast for B2BForecasting energy consumption with no historical data when there is a trendAre RNN or LSTM appropriate Neural Networks approaches for multivariate time-series regression?

Unreliable Magic - Is it worth it?

Make solar eclipses exceedingly rare, but still have new moons

Can I equip Skullclamp on a creature I am sacrificing?

How to place nodes around a circle from some initial angle?

What connection does MS Office have to Netscape Navigator?

Should I tutor a student who I know has cheated on their homework?

Is there a way to save my career from absolute disaster?

In excess I'm lethal

Inappropriate reference requests from Journal reviewers

Decomposition of product of two Plucker coordinates

Is it professional to write unrelated content in an almost-empty email?

Why do professional authors make "consistency" mistakes? And how to avoid them?

Customer Requests (Sometimes) Drive Me Bonkers!

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Why do we use the plural of movies in this phrase "We went to the movies last night."?

Won the lottery - how do I keep the money?

Why didn't Khan get resurrected in the Genesis Explosion?

If the heap is zero-initialized for security, then why is the stack merely uninitialized?

Why this way of making earth uninhabitable in Interstellar?

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

Are police here, aren't itthey?

WOW air has ceased operation, can I get my tickets refunded?

Combine columns from several files into one

Where do students learn to solve polynomial equations these days?



Analysis of Time Series data



The Next CEO of Stack Overflow
2019 Community Moderator ElectionTime series prediction using ARIMA vs LSTMTime Series Analysis in RForecasting non-negative sparse time-series dataForecasting one time series with missing data with help of other time seriesWhat are the prerequisites before running Holt Winters Model?Continuously predicting eventsTime series forecasting using multiple time series as training datademand forecast for B2BForecasting energy consumption with no historical data when there is a trendAre RNN or LSTM appropriate Neural Networks approaches for multivariate time-series regression?










1












$begingroup$


The below graph is a scatterplot of daily stock price. My aim is to predict future stock price of the company.



From the scatterplot it seems that it is a multiplicative model, so I tried to "decompose" it in R. However it says that "time series has no or less than 2 periods". I also obtained a periodogram, which has only one peak at frequency close to 0.



enter image description here



However, my teacher told me that this time series cannot have a trend therefore to eliminate the seasonality I have to consider its period as 7 and then eliminate it choosing an appropriate model.
Can anyone tell me what could be an appropriate model along with a proper justification? Also is it true that the series cannot have a trend?










share|improve this question









$endgroup$
















    1












    $begingroup$


    The below graph is a scatterplot of daily stock price. My aim is to predict future stock price of the company.



    From the scatterplot it seems that it is a multiplicative model, so I tried to "decompose" it in R. However it says that "time series has no or less than 2 periods". I also obtained a periodogram, which has only one peak at frequency close to 0.



    enter image description here



    However, my teacher told me that this time series cannot have a trend therefore to eliminate the seasonality I have to consider its period as 7 and then eliminate it choosing an appropriate model.
    Can anyone tell me what could be an appropriate model along with a proper justification? Also is it true that the series cannot have a trend?










    share|improve this question









    $endgroup$














      1












      1








      1





      $begingroup$


      The below graph is a scatterplot of daily stock price. My aim is to predict future stock price of the company.



      From the scatterplot it seems that it is a multiplicative model, so I tried to "decompose" it in R. However it says that "time series has no or less than 2 periods". I also obtained a periodogram, which has only one peak at frequency close to 0.



      enter image description here



      However, my teacher told me that this time series cannot have a trend therefore to eliminate the seasonality I have to consider its period as 7 and then eliminate it choosing an appropriate model.
      Can anyone tell me what could be an appropriate model along with a proper justification? Also is it true that the series cannot have a trend?










      share|improve this question









      $endgroup$




      The below graph is a scatterplot of daily stock price. My aim is to predict future stock price of the company.



      From the scatterplot it seems that it is a multiplicative model, so I tried to "decompose" it in R. However it says that "time series has no or less than 2 periods". I also obtained a periodogram, which has only one peak at frequency close to 0.



      enter image description here



      However, my teacher told me that this time series cannot have a trend therefore to eliminate the seasonality I have to consider its period as 7 and then eliminate it choosing an appropriate model.
      Can anyone tell me what could be an appropriate model along with a proper justification? Also is it true that the series cannot have a trend?







      r time-series forecast data-analysis






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 20 at 17:06









      Jor_ElJor_El

      312




      312




















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Have you tried taking the first difference? This amounts to taking the first derivative, and is generally a good way to de-trend a time series.



          However, if you want to use seasonality, fit a regression model of form
          $$
          X_t = X_t-k + epsilon
          $$

          where $k$ is the number of time periods between seasons. For example, if you have monthly observations, using $k=12$ might make sense, as this removes the annual seasonality.






          share|improve this answer









          $endgroup$












          • $begingroup$
            Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
            $endgroup$
            – Jor_El
            Feb 21 at 9:29











          • $begingroup$
            The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
            $endgroup$
            – David Atlas
            Feb 21 at 12:58










          • $begingroup$
            What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
            $endgroup$
            – Jor_El
            Feb 21 at 20:53











          • $begingroup$
            See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
            $endgroup$
            – David Atlas
            Feb 21 at 21:17












          Your Answer





          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "557"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f45902%2fanalysis-of-time-series-data%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0












          $begingroup$

          Have you tried taking the first difference? This amounts to taking the first derivative, and is generally a good way to de-trend a time series.



          However, if you want to use seasonality, fit a regression model of form
          $$
          X_t = X_t-k + epsilon
          $$

          where $k$ is the number of time periods between seasons. For example, if you have monthly observations, using $k=12$ might make sense, as this removes the annual seasonality.






          share|improve this answer









          $endgroup$












          • $begingroup$
            Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
            $endgroup$
            – Jor_El
            Feb 21 at 9:29











          • $begingroup$
            The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
            $endgroup$
            – David Atlas
            Feb 21 at 12:58










          • $begingroup$
            What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
            $endgroup$
            – Jor_El
            Feb 21 at 20:53











          • $begingroup$
            See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
            $endgroup$
            – David Atlas
            Feb 21 at 21:17
















          0












          $begingroup$

          Have you tried taking the first difference? This amounts to taking the first derivative, and is generally a good way to de-trend a time series.



          However, if you want to use seasonality, fit a regression model of form
          $$
          X_t = X_t-k + epsilon
          $$

          where $k$ is the number of time periods between seasons. For example, if you have monthly observations, using $k=12$ might make sense, as this removes the annual seasonality.






          share|improve this answer









          $endgroup$












          • $begingroup$
            Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
            $endgroup$
            – Jor_El
            Feb 21 at 9:29











          • $begingroup$
            The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
            $endgroup$
            – David Atlas
            Feb 21 at 12:58










          • $begingroup$
            What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
            $endgroup$
            – Jor_El
            Feb 21 at 20:53











          • $begingroup$
            See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
            $endgroup$
            – David Atlas
            Feb 21 at 21:17














          0












          0








          0





          $begingroup$

          Have you tried taking the first difference? This amounts to taking the first derivative, and is generally a good way to de-trend a time series.



          However, if you want to use seasonality, fit a regression model of form
          $$
          X_t = X_t-k + epsilon
          $$

          where $k$ is the number of time periods between seasons. For example, if you have monthly observations, using $k=12$ might make sense, as this removes the annual seasonality.






          share|improve this answer









          $endgroup$



          Have you tried taking the first difference? This amounts to taking the first derivative, and is generally a good way to de-trend a time series.



          However, if you want to use seasonality, fit a regression model of form
          $$
          X_t = X_t-k + epsilon
          $$

          where $k$ is the number of time periods between seasons. For example, if you have monthly observations, using $k=12$ might make sense, as this removes the annual seasonality.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 21 at 1:18









          David AtlasDavid Atlas

          312




          312











          • $begingroup$
            Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
            $endgroup$
            – Jor_El
            Feb 21 at 9:29











          • $begingroup$
            The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
            $endgroup$
            – David Atlas
            Feb 21 at 12:58










          • $begingroup$
            What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
            $endgroup$
            – Jor_El
            Feb 21 at 20:53











          • $begingroup$
            See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
            $endgroup$
            – David Atlas
            Feb 21 at 21:17

















          • $begingroup$
            Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
            $endgroup$
            – Jor_El
            Feb 21 at 9:29











          • $begingroup$
            The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
            $endgroup$
            – David Atlas
            Feb 21 at 12:58










          • $begingroup$
            What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
            $endgroup$
            – Jor_El
            Feb 21 at 20:53











          • $begingroup$
            See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
            $endgroup$
            – David Atlas
            Feb 21 at 21:17
















          $begingroup$
          Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
          $endgroup$
          – Jor_El
          Feb 21 at 9:29





          $begingroup$
          Isn't the above formula valid if time series is additive? Also how did you know that the given time series is additive?
          $endgroup$
          – Jor_El
          Feb 21 at 9:29













          $begingroup$
          The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
          $endgroup$
          – David Atlas
          Feb 21 at 12:58




          $begingroup$
          The above construct only helps remove the seasonality from $k$ time periods ago. If the time series does not have seasonality, the regression model should have very small coefficients. You can also use regularization to determine if the coefficients should be non-zero.
          $endgroup$
          – David Atlas
          Feb 21 at 12:58












          $begingroup$
          What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
          $endgroup$
          – Jor_El
          Feb 21 at 20:53





          $begingroup$
          What model(additive or multiplicative) do you think the above time series follows?Also, how would I check whether seasonality is present or not?
          $endgroup$
          – Jor_El
          Feb 21 at 20:53













          $begingroup$
          See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
          $endgroup$
          – David Atlas
          Feb 21 at 21:17





          $begingroup$
          See this link for more information on how to tell if a time series is additive or multiplicative:r-bloggers.com/is-my-time-series-additive-or-multiplicative My answer above shows how to test for seasonality. Simply use the p-values of the regression model to inform if significant seasonality is present.
          $endgroup$
          – David Atlas
          Feb 21 at 21:17


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Data Science Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f45902%2fanalysis-of-time-series-data%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Is flight data recorder erased after every flight?When are black boxes used?What protects the location beacon (pinger) of a flight data recorder?Is there anywhere I can pick up raw flight data recorder information?Who legally owns the Flight Data Recorder?Constructing flight recorder dataWhy are FDRs and CVRs still two separate physical devices?What are the data elements shown on the GE235 flight data recorder (FDR) plot?Are CVR and FDR reset after every flight?What is the format of data stored by a Flight Data Recorder?How much data is stored in the flight data recorder per hour in a typical flight of an A380?Is a smart flight data recorder possible?

          Which is better: GPT or RelGAN for text generation?2019 Community Moderator ElectionWhat is the difference between TextGAN and LM for text generation?GANs (generative adversarial networks) possible for text as well?Generator loss not decreasing- text to image synthesisChoosing a right algorithm for template-based text generationHow should I format input and output for text generation with LSTMsGumbel Softmax vs Vanilla Softmax for GAN trainingWhich neural network to choose for classification from text/speech?NLP text autoencoder that generates text in poetic meterWhat is the interpretation of the expectation notation in the GAN formulation?What is the difference between TextGAN and LM for text generation?How to prepare the data for text generation task

          Is there a general name for the setup in which payoffs are not known exactly but players try to influence each other's perception of the payoffs?Osborne, Nash equilibria and the correctness of beliefsIs there a name for this family of games (Binomial games?)?Perfect Bayesian EquilibriumCalculating mixed strategy equilibrium in battle of sexesPure Strategy SPNEIs there a commitment mechanism which allows players to achieve pareto optimal solutions?Extensive Form GamesAn $n$-player prisoner's dilemma where a coalition of 2 players is better off defectingTit-For-Stat Strategy Best RepliesPotential solutions of the $n$-player Prisoner's Dilemma