Sine Function with Alternating Peaks and Wavelengths

Click For Summary

Discussion Overview

The discussion revolves around finding a sine function that accurately models the cyclic and seasonal nature of retail sales data over the course of a year. Participants explore various mathematical approaches, including polynomial fitting and Fourier series, to achieve a suitable representation of the data.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant describes their attempts to model retail sales data using a fifth-order polynomial and expresses uncertainty about finding a simple sine function that captures the seasonal pattern.
  • Another participant suggests fitting the data to a Fourier series, noting that Fourier series are designed to identify frequency components in periodic data.
  • A different participant agrees that a single sine or cosine function may not suffice, but a sum of such functions (a Fourier series) could effectively model the data.
  • A participant expresses confusion about the distinction between Fourier series and the Fast Fourier Transform (FFT), indicating a need for clarification on how to proceed with the Fourier series approach.
  • One participant shares a resource they found that outlines calculations related to Fourier transforms, seeking confirmation that they are on the right track.

Areas of Agreement / Disagreement

Participants generally agree that a single sine function is insufficient for modeling the data, and that a Fourier series may be a more appropriate approach. However, there is no consensus on the specific methods or steps to take in applying the Fourier series to the data.

Contextual Notes

Participants express varying levels of familiarity with the mathematical concepts involved, particularly regarding Fourier series and transforms, which may affect their ability to engage with the discussion fully.

hddd123456789
Messages
92
Reaction score
0
Hi All,

I'm trying to find a sine function that models the cyclic and seasonal nature of retail sales across the years. I've tried several combinations including some basic attempts at complex plots of sin(x), but am now starting to wonder if there is even a simple solution to the problem. I've searched google for images of plots but maybe I'm not entering the right keywords?

Anyway I'm going to have to write out the description. The units right now don't matter since I can't even get the proper shape of the curve. I did a polynomial fit to average monthly data and got the fifth order polynomial that fits the data from x=1 to x=12 (for the months 1 to 12):

y = -1.225*x^5 + 40.785*x^4 - 479.82*x^3 + 2325.3*x^2 - 4029.5*x + 1554.433 view wolframalpha plot

I'm basically trying to find a sine function that repeats this basic pattern for every year since I need to then apply time-dependent attenuation and perhaps other functions to it. The closest I got was through complex plots like this:

y = (sin(pi*x-pi/2)) - re(sqrt(sin(pi/2*(x+2))))^2 view wolframalpha plot

Will greatly appreciate any help!
 
Mathematics news on Phys.org
Have you tried fitting your data to a fourier series?

Fourier series are basically made to find all of the frequency components of periodic data.
 
There won't exit a single sine (or cosine) function that models that but a sum of such functions can (that is the "Fourier series" Mute mentions).
 
Mute said:
Have you tried fitting your data to a fourier series?

Fourier series are basically made to find all of the frequency components of periodic data.

I haven't, how do you do that exactly? ;)

I'll just go ahead and assume that I'm in over my head with the actual math behind this for the moment. I am a programmer however, and found a nifty class that is supposed to perform a "Fast Fourier Transform" which calculates the "discrete Fourier transform". But this is apparently quite different than the Fourier series (from a google search).

Ok, some more searching around and I found this:

http://www.public.iastate.edu/~akmitra/aero361/design_web/crvft.html

at the bottom of which there is a link to an excel file that basically lays out all the calculations done. This seems to be what I need, and I would appreciate if someone could point out that I'm going in the right direction.

Many thanks!
 

Similar threads

Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
2K