Fourier Series and Fourier Transform

References http://www.math.psu.edu/wysocki/M412/Notes412_8.pdf https://zhuanlan.zhihu.com/p/19763358 https://www.math.psu.edu/tseng/class/Math251/Notes-PDE%20pt2.pdf http://www.oulu.fi/sites/default/files/content/files/series.pdf http://www.engr.uconn.edu/~lanbo/G377FFTYC.pdf Fourier Series Theorem (references: Second Order Linear Partial Differential Equations, 复数形式傅立叶变换的物理意义,相位究竟指的是什么?) \(\text{Suppose } f(x) \text{ is a periodic function with period } T \text{ and is an integrable function on } [0, T]. \\ \text{Then, the Fourier Series of } f(x) \text{ can be written as }\) \[ \begin{align} f(x) & = \frac{c_0}{2} + \sum_{n=1}^{\infty} c_ncos(n \cdot \frac{2\pi}{T} \cdot x + \varphi_n) \\ &= \frac{c_0}{2} + \sum_{n=1}^{\infty} c_ncos(\varphi _n)cos(n \cdot \frac{2\pi}{T} \cdot x)+ (-c_n)sin(\varphi _n)sin(n \cdot \frac{2\pi}{T} \cdot x) \\ &\text{( let } a_0 = c_0, \;a_n = c_ncos(\varphi _n) \text{ and } b_n = (-c_n)sin(\varphi _n) \;) \\ &= \frac{a_0}{2} + \sum_{n=1}^{\infty} a_ncos(n \cdot \frac{2\pi}{T} \cdot x)+ b_nsin(n \cdot \frac{2\pi}{T} \cdot x) \\ \\ \text{where } c_n &= \sqrt{a_n^2 + b_n^2} = \sqrt{c_n^2(cos^2(\varphi _n) + sin^2(\varphi _n))} = \sqrt{c_n^2} \;\; (Amplitude)\\ \varphi_n &= tan^{-1}(-\frac{b_n}{a_n}) \;\; (Phase)\\ a_0 &= \frac{1}{T}\int_{0}^{T}f(x)dx \\ a_n &= \frac{1}{T}\int_{0}^{T}f(x) \cdot cos(n \cdot \frac{2\pi}{T} \cdot x)dx \\ b_n &= \frac{1}{T}\int_{0}^{T}f(x) \cdot sin(n \cdot \frac{2\pi}{T} \cdot x)dx \end{align} \]

Read More

BATS and TBATS Model

BATS model is Exponential Smoothing Method + Box-Cox Transformation + ARMA model for residuals. The Box-Cox Transformation here is for dealing with non-linear data and ARMA model for residuals can de-correlated the time series data. Alysha M.(2010) has proved that BATS model can improve the prediction performance compared to the simple Sate Space Model. However, BATS model does not do well when the the seaonality is complex and high frequency.

Read More

State Space Model for Exponential Smoothing

The main weakness of original Exponential Smoothing Method is that it can only provide point estimation. Hyndman (2002) proposed using state space framework to rewrite the original exponential smoothing algorithm and then give distribution assumption on the error terms to calculate the prediction interval. There are two types of error terms in the state space model: Additive and Multiplicative. The point estimator for these two models are the same but the prediction intervals are different.

Read More

Exponential Smoothing

This post is about Exponential Smoothing method, a prediction method for time series data. There are many forms of Exponential Smoothing method and the most basic ones are Single, Double and Triple (Holt-Winters) Exponential Smoothing. Some of the Exponential Smoothing forms can be written as ARIMA model; some of them can not and vice versa. Compared to ARIMA model, Exponential Smoothing method do not have strong model assumptions and it also can not add explanatory variables in the algorithm.

Read More

LDA and QDA

LDA and QDA are classification methods based on the concept of Bayes’ Theorem with assumption on conditional Multivariate Normal Distribution. And, because of this assumption, LDA and QDA can only be used when all explanotary variables are numeric. This post is my note about LDA and QDA, classification teachniques. All the contents in this post are based on my reading on many resources which are listed in the References part.

Read More

R --- LDA and QDA

This post shows the R code for LDA and QDA by using funtion lda() and qda() in package MASS. To show how to use these function, I created a function, bvn(), to generate bivariate normal dataset based on the assumptions and then used lda() and qda() on the generated datasets. Details Resources for Package ‘MASS’ CRAN - Package ‘MASS’ Package ‘MASS’ - Reference manual Example Code LDA : Suppose our dataset are from \[X_{green}=N(\begin{pmatrix} 0.

Read More