03. Time Series Analysis (Jhon)
Methods
How to remove seasonality
There are two forms of ridding the original of seasonality, by either dividing by appropriate seasonal indices or by subtracting them.
Method
- Form the mean for each season
- for additive.
- for multiplicative.
Fourier Series Model for Seasonality
Using Fourier Series Model for modeling Seasonality.
Any periodic function satisfies the relation: where is the period of the function.
The simplest and most common periodic functions are the trigonometric functions. The functions and being harmonic are by definition periodic with periods . Because trigonometric functions are relatively easy to work with and because they possess the important property of orthogonality they are useful to represent the seasonality of data of this type.
orthonormal set.
Because this set of functions is complete in the interval every function which is continuous in that interval can be represented by the Fourier Series
where the constants and are known as the Fourier coefficients.
Now, if we multiply both sides by and integrate we get
For , this yields so may be referred to as the average value of . if then it reduces to and . When is an even series, that is, is reflected at the origin, the coefficients vanish and the series is known as a Fourier cosine series. Similarly when the series is an odd series, the a coefficients vanish and the series is known as a Fourier sine series.
Discrete Fourier Transform (DFT)
- What we need for our purposes is the discrete version of the series representation.
- We also need to adjust the period, where in the case of the deaths data, the fundamental period is 12 months.
- We will also consider how to find how many terms we use in the expansion.
The discrete Fourier Transform of a sequence of real or complex numbers, is the sequence of complex numbers defined by
Inverse Discrete Fourier Transform (IDFT)
The original can be recovered using the Inverse DFT or IDFT, defined by
Assume are real numbers and thus
for even
for odd
Power Spectrum
- Note that is we used the formulae above we would capture all the values.
- But, the Principle of Parsimony leads us to construct the model that fits the data best with the least number of coefficients.
- Note that this will also the one that is most identifiable in a physical sense - it has meaning.
- We do this by identifying the most important frequencies to include via using the so-called Power Spectrum.
I will use a particular form that has useful corresponding meaning:
In this form, it also gives the variance explained by the inclusion of that frequency in the Fourier series.
Fourier Series Representation
Methods of Estimating Parameters
- Direct calculation.
- Optimisation.
- Linear Regression.
- I will show how to do all of these, but in the next slides I will show a particular form of how to use regression for this.
Normal Equations for Regression
Let
,
,
,
,
,
.
Therefore we can rewrite the formula above as
Derivation
The problem is to find to minimise the sum of squared deviations between the model and the data over the day.
To calculate , we take the partial derivatives of with respect to each and set these to zero to form a system of linear equations which we then solve.
The set of equations above can be written in the following form
Intraday Solar Radiation
- One can deal with the seasonalities inherent in climate variable in a multiplicative or additive modelling framework.
- Interestingly, though I will argue that the multiplicative approach is problematic, it is the approach most often used for solar forecasting models in particular. There are two versions of the multiplicative approach with respect to solar radiation, calculating the clearness index, and estimating the clear sky index.
- To form the clearness index, one divides the global solar radiation by the extraterrestrial radiation, a quantity determined only via astronomical formulae. On the other hand the clear sky index involves dividing the global radiation by a clear sky model.
- Note that the wind resource is not as seasonally dependent as the solar radiation, and both multiplicative and additive versions of dealing with seasonality are used.
- Additive de-seasoning is enacted through subtracting a mean function from the solar radiation, that function formed usually through the addition of terms involving a basis of the function space.
- I will argue that an appropriate way to perform this operation is through the use of a Fourier set of basis functions.
Seasonality modelling methods
- Multiplicative, dividing the data by clearness index.
- Multiplicative, dividing the data by clearness sky model.
- Additive, using Fourier series or wavelets.
Clearness Index - advantages and disadvantages
- It is a calculated, not modelled value as the divisor is the so-called extraterrestrial radiation .
- is the result of a calculation using spherical trigonometry applied to the โsolar constantโ.
- From my experience it does not pick up all the seasonal effects.
Clear Sky Index - advantages and disadvantages
- It is based on a physical model of a so-called clear sky, and varies throughout the year.
- It uses some parameter values that vary at high frequency but are assumed to vary at low frequency.
- There are several clear sky models - Ineichen evaluates thirteen.
Seasonality
The first step is to identify and model the seasonality. We have identified several significant cycles using spectral analysis. Fourier series will be used in this step.
ใใใใใใใ
Objectives of time series analysis
- Use model to provide compact description of data
- Recognise presence of seasonal components and remove them so as not to confuse them with long-term trends (seasonal adjustment).
- Other applications of time series models
- Separation (or filtering) of noise from signals
- Prediction of future values of a series
- Testing hypotheses
- Predicting one series from observations of another
- Controlling future values of a series by adjusting parameters
- Time series models are also useful in simulation studies
Some simple time series models
- Important part of time series analysis: select, suitable probability model for data
Definition
A time series model for observed data is a specification of the joint distributions (or only means and covariances) of a sequence of random variables of which is a realization.
- A complete probabilistic time series model for specifies all the probabilities
Such a specification of all joint distributions is rarely used because it contains too many parameters to be estimated from avaliable data.
References
- https://www.youtube.com/watch?v=RwJnPw1tzKM
- https://www.youtube.com/watch?v=aP05EpN1M58&list=PLYEmLA_7ilZPHis6d-xEGqQ_8Enuv_s32&index=4
- https://www.youtube.com/watch?v=fav8_LGY75Y&list=PLYEmLA_7ilZPHis6d-xEGqQ_8Enuv_s32&index=2
- https://www.youtube.com/watch?v=ikkOBWQj9X8&list=PLnG1U6UeKOIir0ytWi8GihemUFUZynWBL
- https://www.youtube.com/watch?v=2mM8BUqWAZ4
- Reference 1
- Reference 2
- Fourier transform
- Power Spectrum
- The seasonality slides from John in SP52023.