Determining if time series follows a pattern Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsHow to deal with time series which change in seasonality or other patterns?Forecasting an individual based on a representative groupTime series data: How I measure influence of new product sales on existing product sales (statistically)?Average and standard deviations around timestampsHow to model to predict hotel booking abnomality?Detecting anomalies from time series correlated variableswhat is the best approach to my prediction problemClassification/Prediction based on Multivariate Time SeriesTime series forecasting using multiple time series as training dataWhat Machine Learning Algorithm could I use to determine some measure in a date?

What *exactly* is electrical current, voltage, and resistance?

Why doesn't the university give past final exams' answers?

If gravity precedes the formation of a solar system, where did the mass come from that caused the gravity?

Does using the Inspiration rules for character defects encourage My Guy Syndrome?

Why aren't road bike wheels tiny?

“Since the train was delayed for more than an hour, passengers were given a full refund.” – Why is there no article before “passengers”?

2 sample t test for sample sizes - 30,000 and 150,000

What could prevent concentrated local exploration?

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

Can I take recommendation from someone I met at a conference?

Coin Game with infinite paradox

How to ask rejected full-time candidates to apply to teach individual courses?

How to leave only the following strings?

"Destructive force" carried by a B-52?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

When does Bran Stark remember Jamie pushing him?

Lights are flickering on and off after accidentally bumping into light switch

Protagonist's race is hidden - should I reveal it?

/bin/ls sorts differently than just ls

What kind of equipment or other technology is necessary to photograph sprites (atmospheric phenomenon)

Are Flameskulls resistant to magical piercing damage?

Why these surprising proportionalities of integrals involving odd zeta values?

Why is one lightbulb in a string illuminated?

Does traveling In The United States require a passport or can I use my green card if not a US citizen?



Determining if time series follows a pattern



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsHow to deal with time series which change in seasonality or other patterns?Forecasting an individual based on a representative groupTime series data: How I measure influence of new product sales on existing product sales (statistically)?Average and standard deviations around timestampsHow to model to predict hotel booking abnomality?Detecting anomalies from time series correlated variableswhat is the best approach to my prediction problemClassification/Prediction based on Multivariate Time SeriesTime series forecasting using multiple time series as training dataWhat Machine Learning Algorithm could I use to determine some measure in a date?










2












$begingroup$


I was wondering if anyone had any idea how to solve this problem.



So basically I have a dataset where some person approximately comes at some regular interval and I don't know what that interval is. I need to determine if the person comes in at approximately regular intervals, not necessarily what is the specifically value of the interval. For example if a certain person comes to my house to deliver milk over some period on say



Week 1: Mon, Wed, Fri,



Week 2:Mon, Wed, Fri



Week 3:Mon, Thu, Fri



Week 4:Mon, Wed, Fri



Week 5:Mon, Wed, Fri



Week 6:Mon, Wed, Fri



Week 7:Mon, Wed, Fri



Week 8:Mon, Thu, Fri



So as we can see out of these 8 weeks only in 2 weeks the person didn't come on Wednesday and instead came on Thursday which can be attributed to maybe a holiday the day before. So the solution to this example is that the person does follow a regular pattern.



Similarly this is another example. Say the person came on -



Mon, Thu, Sun, Wed, Sat, Tue, Fri, Mon, Wed, Sun



where this person follows a regular pattern because except for the last Wednesday he comes every fourth day.



This is an example of where a person doesn't follow a pattern, say the person came on



Mon, Wed, Sat, Fri, Thu, Fri, Wed, Fri, Sun, Sun, Sat



I have to do this for hundreds of different people.



Another equivalent problem is if I know which days over a certain period of time (say a month) some person arrives I need to determine if they follow some pattern or not



I thought about trying to fit the data into a sinusoidal curve but I'm not sure if it will work when I have a person who comes every say Mon, Tue, Fri or the 7th of every month or the first and third monday of every month etc.



I'm open to any method as long as it has good accuracy. Also, depending on whichever algorithm you think is best, if possible could you share a link to some code which solves a similar problem so I can get a general idea of how I'm supposed to implement my algorithm. I'm pretty new to machine learning / data science. Thank You!










share|improve this question











$endgroup$
















    2












    $begingroup$


    I was wondering if anyone had any idea how to solve this problem.



    So basically I have a dataset where some person approximately comes at some regular interval and I don't know what that interval is. I need to determine if the person comes in at approximately regular intervals, not necessarily what is the specifically value of the interval. For example if a certain person comes to my house to deliver milk over some period on say



    Week 1: Mon, Wed, Fri,



    Week 2:Mon, Wed, Fri



    Week 3:Mon, Thu, Fri



    Week 4:Mon, Wed, Fri



    Week 5:Mon, Wed, Fri



    Week 6:Mon, Wed, Fri



    Week 7:Mon, Wed, Fri



    Week 8:Mon, Thu, Fri



    So as we can see out of these 8 weeks only in 2 weeks the person didn't come on Wednesday and instead came on Thursday which can be attributed to maybe a holiday the day before. So the solution to this example is that the person does follow a regular pattern.



    Similarly this is another example. Say the person came on -



    Mon, Thu, Sun, Wed, Sat, Tue, Fri, Mon, Wed, Sun



    where this person follows a regular pattern because except for the last Wednesday he comes every fourth day.



    This is an example of where a person doesn't follow a pattern, say the person came on



    Mon, Wed, Sat, Fri, Thu, Fri, Wed, Fri, Sun, Sun, Sat



    I have to do this for hundreds of different people.



    Another equivalent problem is if I know which days over a certain period of time (say a month) some person arrives I need to determine if they follow some pattern or not



    I thought about trying to fit the data into a sinusoidal curve but I'm not sure if it will work when I have a person who comes every say Mon, Tue, Fri or the 7th of every month or the first and third monday of every month etc.



    I'm open to any method as long as it has good accuracy. Also, depending on whichever algorithm you think is best, if possible could you share a link to some code which solves a similar problem so I can get a general idea of how I'm supposed to implement my algorithm. I'm pretty new to machine learning / data science. Thank You!










    share|improve this question











    $endgroup$














      2












      2








      2





      $begingroup$


      I was wondering if anyone had any idea how to solve this problem.



      So basically I have a dataset where some person approximately comes at some regular interval and I don't know what that interval is. I need to determine if the person comes in at approximately regular intervals, not necessarily what is the specifically value of the interval. For example if a certain person comes to my house to deliver milk over some period on say



      Week 1: Mon, Wed, Fri,



      Week 2:Mon, Wed, Fri



      Week 3:Mon, Thu, Fri



      Week 4:Mon, Wed, Fri



      Week 5:Mon, Wed, Fri



      Week 6:Mon, Wed, Fri



      Week 7:Mon, Wed, Fri



      Week 8:Mon, Thu, Fri



      So as we can see out of these 8 weeks only in 2 weeks the person didn't come on Wednesday and instead came on Thursday which can be attributed to maybe a holiday the day before. So the solution to this example is that the person does follow a regular pattern.



      Similarly this is another example. Say the person came on -



      Mon, Thu, Sun, Wed, Sat, Tue, Fri, Mon, Wed, Sun



      where this person follows a regular pattern because except for the last Wednesday he comes every fourth day.



      This is an example of where a person doesn't follow a pattern, say the person came on



      Mon, Wed, Sat, Fri, Thu, Fri, Wed, Fri, Sun, Sun, Sat



      I have to do this for hundreds of different people.



      Another equivalent problem is if I know which days over a certain period of time (say a month) some person arrives I need to determine if they follow some pattern or not



      I thought about trying to fit the data into a sinusoidal curve but I'm not sure if it will work when I have a person who comes every say Mon, Tue, Fri or the 7th of every month or the first and third monday of every month etc.



      I'm open to any method as long as it has good accuracy. Also, depending on whichever algorithm you think is best, if possible could you share a link to some code which solves a similar problem so I can get a general idea of how I'm supposed to implement my algorithm. I'm pretty new to machine learning / data science. Thank You!










      share|improve this question











      $endgroup$




      I was wondering if anyone had any idea how to solve this problem.



      So basically I have a dataset where some person approximately comes at some regular interval and I don't know what that interval is. I need to determine if the person comes in at approximately regular intervals, not necessarily what is the specifically value of the interval. For example if a certain person comes to my house to deliver milk over some period on say



      Week 1: Mon, Wed, Fri,



      Week 2:Mon, Wed, Fri



      Week 3:Mon, Thu, Fri



      Week 4:Mon, Wed, Fri



      Week 5:Mon, Wed, Fri



      Week 6:Mon, Wed, Fri



      Week 7:Mon, Wed, Fri



      Week 8:Mon, Thu, Fri



      So as we can see out of these 8 weeks only in 2 weeks the person didn't come on Wednesday and instead came on Thursday which can be attributed to maybe a holiday the day before. So the solution to this example is that the person does follow a regular pattern.



      Similarly this is another example. Say the person came on -



      Mon, Thu, Sun, Wed, Sat, Tue, Fri, Mon, Wed, Sun



      where this person follows a regular pattern because except for the last Wednesday he comes every fourth day.



      This is an example of where a person doesn't follow a pattern, say the person came on



      Mon, Wed, Sat, Fri, Thu, Fri, Wed, Fri, Sun, Sun, Sat



      I have to do this for hundreds of different people.



      Another equivalent problem is if I know which days over a certain period of time (say a month) some person arrives I need to determine if they follow some pattern or not



      I thought about trying to fit the data into a sinusoidal curve but I'm not sure if it will work when I have a person who comes every say Mon, Tue, Fri or the 7th of every month or the first and third monday of every month etc.



      I'm open to any method as long as it has good accuracy. Also, depending on whichever algorithm you think is best, if possible could you share a link to some code which solves a similar problem so I can get a general idea of how I'm supposed to implement my algorithm. I'm pretty new to machine learning / data science. Thank You!







      machine-learning time-series






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 5 at 6:08







      maxachmed

















      asked Apr 5 at 5:44









      maxachmedmaxachmed

      113




      113




















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          It appears as though you are attempting to determine the presence of seasonality in this time series, i.e. a process that repeats itself at regular intervals.



          In this regard, it might be a good idea to decompose your time series and check for the presence of seasonality trends.



          As an example, this graph in R shows clear seasonality patterns for weather across different seasons:



          seasonality



          By decomposing the series, this might give visual cues as to whether seasonality exists among visits by individuals at particular times.






          share|improve this answer









          $endgroup$












          • $begingroup$
            Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
            $endgroup$
            – maxachmed
            Apr 5 at 15:43











          • $begingroup$
            Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
            $endgroup$
            – Michael Grogan
            Apr 5 at 15:52











          Your Answer








          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%2f48653%2fdetermining-if-time-series-follows-a-pattern%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$

          It appears as though you are attempting to determine the presence of seasonality in this time series, i.e. a process that repeats itself at regular intervals.



          In this regard, it might be a good idea to decompose your time series and check for the presence of seasonality trends.



          As an example, this graph in R shows clear seasonality patterns for weather across different seasons:



          seasonality



          By decomposing the series, this might give visual cues as to whether seasonality exists among visits by individuals at particular times.






          share|improve this answer









          $endgroup$












          • $begingroup$
            Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
            $endgroup$
            – maxachmed
            Apr 5 at 15:43











          • $begingroup$
            Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
            $endgroup$
            – Michael Grogan
            Apr 5 at 15:52















          0












          $begingroup$

          It appears as though you are attempting to determine the presence of seasonality in this time series, i.e. a process that repeats itself at regular intervals.



          In this regard, it might be a good idea to decompose your time series and check for the presence of seasonality trends.



          As an example, this graph in R shows clear seasonality patterns for weather across different seasons:



          seasonality



          By decomposing the series, this might give visual cues as to whether seasonality exists among visits by individuals at particular times.






          share|improve this answer









          $endgroup$












          • $begingroup$
            Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
            $endgroup$
            – maxachmed
            Apr 5 at 15:43











          • $begingroup$
            Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
            $endgroup$
            – Michael Grogan
            Apr 5 at 15:52













          0












          0








          0





          $begingroup$

          It appears as though you are attempting to determine the presence of seasonality in this time series, i.e. a process that repeats itself at regular intervals.



          In this regard, it might be a good idea to decompose your time series and check for the presence of seasonality trends.



          As an example, this graph in R shows clear seasonality patterns for weather across different seasons:



          seasonality



          By decomposing the series, this might give visual cues as to whether seasonality exists among visits by individuals at particular times.






          share|improve this answer









          $endgroup$



          It appears as though you are attempting to determine the presence of seasonality in this time series, i.e. a process that repeats itself at regular intervals.



          In this regard, it might be a good idea to decompose your time series and check for the presence of seasonality trends.



          As an example, this graph in R shows clear seasonality patterns for weather across different seasons:



          seasonality



          By decomposing the series, this might give visual cues as to whether seasonality exists among visits by individuals at particular times.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 5 at 14:29









          Michael GroganMichael Grogan

          1964




          1964











          • $begingroup$
            Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
            $endgroup$
            – maxachmed
            Apr 5 at 15:43











          • $begingroup$
            Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
            $endgroup$
            – Michael Grogan
            Apr 5 at 15:52
















          • $begingroup$
            Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
            $endgroup$
            – maxachmed
            Apr 5 at 15:43











          • $begingroup$
            Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
            $endgroup$
            – Michael Grogan
            Apr 5 at 15:52















          $begingroup$
          Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
          $endgroup$
          – maxachmed
          Apr 5 at 15:43





          $begingroup$
          Thank you. I don't think this is a feasible solution because unless I misunderstood you I won't possibly be able to check each time series for a person visually if I have to to do it for hundreds of people.
          $endgroup$
          – maxachmed
          Apr 5 at 15:43













          $begingroup$
          Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
          $endgroup$
          – Michael Grogan
          Apr 5 at 15:52




          $begingroup$
          Fair point. While I would recommend examining seasonality in any case, one thing you could do is obtain the differences in visits across the dataset, i.e. 2 days, 3 days between each visit, etc. Then, plot these differences using a histogram - if you find that one particular time lag stands out then you could use this as a generalisation.
          $endgroup$
          – Michael Grogan
          Apr 5 at 15:52

















          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%2f48653%2fdetermining-if-time-series-follows-a-pattern%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

          Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

          Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

          Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?