Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

FOURIER SERIES NONPARAMETRIC REGRESSION MODELING IN THE CASE OF

RAINFALL IN WEST JAVA PROVINCE

Abstract
Fourier series is a trigonometric polynomial that has flexibility, so it can adjust effectively to the
local properties of the data. This Fourier series estimator is generally used when the data used to
investigate the pattern is unknown and there is a trend towards a seasonal pattern. This study
concerns the nonparametric regression model of the Fourier series which is estimated using the
method Ordinary Least Square. Nonparametric regression using the Fourier series approach was
applied to Rainfall data in West Java Province in 2015-2019. The independent variables used are
the average air humidity, air pressure, wind speed, and air temperature. The nonparametric
regression model is the best Fourier series with K =13 values obtained GCV, MSE, and R 2
respectively are 549,92; 462,09; and 97,30%. The results obtained that the variables of air humidity
and air pressure have a significant effect on rainfall.
Keywords: Fourier Series, GCV, MSE, Nonparametric Regression, Rainfall

INTRODUCTION
In Indonesia, rain is a very important climate element due to its high diversity. In general, the
nature of rain is that the shorter the rainfall, the higher the intensity and the greater the return
period, the higher the intensity. According to the conditions in Indonesia, where the temperature is
not so much and changes quickly. The average amount of rain that falls in each month and year in a
place is not always the same.
Rain can be beneficial for living things, as explained in the word of Allah SWT. QS An-Nahl
verse 10 as follows:
َ‫ي اَ ْنزَ َل ِمنَ ال َّس َم ۤا ِء َم ۤا ًء لَّ ُك ْم ِّم ْنهُ َش َرابٌ َّو ِم ْنهُ َش َج ٌر فِ ْي ِه تُ ِس ْي ُموْ ن‬
ْٓ ‫ه َُو الَّ ِذ‬
"It is He who has sent down water (rain) from the sky for you, some of it as drink and some of it
(fertilizing) plants, on it you graze your livestock."
High rainfall can also be the cause of natural disasters such as floods, landslides, and so on.
Floods occurred in Bogor Regency, Indramayu Regency, Sukabumi City, Purwakarta Regency,
West Java in January 2020 which resulted in several people being killed because they were carried
away by currents during floods and damaged houses. The presence of high rainfall will also trigger
landslides as has happened in several regencies and cities, including Sumedang, Cimahi, Bandung,
Ciamis, Sukabumi, and Bogor which occurred in January 2020. Meteorology, Climatology and
Geophysics (BMKG) in 2019 for every province in Indonesia, especially in Java, that West Java
Province ranks first for data on the highest amount of rainfall on Java Island in 2019. Therefore, it is
very interesting to model the amount of rainfall that can be estimated useful for practitioners and
researchers.
In this study using the Fourier series approach. The Fourier series is a trigonometric
polynomial that has flexibility, so it can adapt effectively to the local nature of the data. According
to Suparti, et al. (2018) The Fourier series is very good for data that forms a distribution of sine and
cosine waves. This Fourier series estimator is generally used if the data used is investigated for
unknown patterns and there is a tendency for seasonal patterns (Chamidah, 2020). This study will
use a Fourier series model approach because this model is proven to be suitable for modeling and
predicting the amount of rainfall. Research on Fourier series regression modeling in multivariable
nonparametric regression refers to previous research conducted by Ni Putu Ayu Mirah Mariati
(2015) and Alan Prahutama (2013). The purpose of this study was to find the results of the best
Fourier series nonparametric regression model for rainfall data by month in West Java Province in
2015-2019 and to determine the level of model accuracy.

METHODOLOGY
1) Literatur Reviews
Rainfall is the height of rainwater that collects in a flat place, does not evaporate, does not
seep, and does not flow. Rainfall data is data with seasonal pattern and suitable to be modeled using
nonparametric regression analysis with Fourier series approach. The background of this research is
because research on rainfall models and predictions with several independent variables has not been
carried out. Research on Fourier series regression modeling in multivariable nonparametric
regression refers to previous research conducted by Ni Putu Ayu Mirah Mariati (2015) which
concluded that predictions using nonparametric regression with a Fourier series approach were good
for data whose patterns were unknown and tended to repeat themselves. The Fourier series is also
very good for use on data that is only random and is not detected seasonally because the Fourier
series is a nonparametric regression where its characteristics match the data (Alan Prahutama,
2013).

2) Analysis Method
Fourier Series
The series was introduced by Joseph Fourier (1768-1830) to solve the problem of heat
equations in metal plates. In mathematics, the Fourier series is the decomposition of periodic
functions into the sum of oscillating functions, namely sine and cosine functions or complex
exponentials (Damanik, 2010). According to Octavanny, et al. (2015) Fourier series is useful for
describing curves showing sine and cosine waves, generally used when the data pattern is unknown
and there is a tendency to iterate. Chamidah (2020) states that the Fourier series is a trigonometric
polynomial function that has a high degree of flexibility. This is because the Fourier series is a
curve that shows the sine cosine function. The advantage of the Fourier series estimation is that it is
able to handle data characters that follow repeated patterns at certain trend intervals and have good
statistical interpretations (Mariati, et al, 2020).
Estimating Nonparametric Regression Parameters Fourier Series
Given a multivariable nonparametric regression model:
Yi  m  X 1i , X 2i ,..., X qi    i
q
  f j  X ji    i , i  1, 2,..., n
j 1 (1)
Description:
Yi : response variable on the i observation
Xji : Nonparametric components where X=X1i,X2i,...,Xqi
Ɛi : residual value
Fj(Xij) : unknown regression curve
i : 1,2,3,...,n
n : number of sample data
In nonparametric regression estimation using Fourier series, the function f is assumed to be
unknown and contained in a continuous function space. The residuals are assumed to be normally
distributed with a mean of zero and for constant and independent variance.
The model of the Fourier series equation is given as follows:
Y i=f ( X ij ) +ε i (2)
Where,
i : 1,2,3,…,n
j : 1,2,3,…,m
Based on the character of the rainfall data which is never negative, the more precise form of
the Fourier series function as a predictor of rainfall is an even function. Even if the function is
expanded into a Fourier series, then it only contains cosine terms or a constant that can be
considered as cosine (because a n ≠ 0 , bn=0).
Serov (2017) states that to determine the Fourier coefficients a 0 , a n , bn of even and odd

1
periodic functions with L= T the following formulation is used:
2
f  x
If is even, then:
L
2
f  x  dx
L 0
a0 

n x
L
2
an   f  x  cos dx
L0 L
bn  0 (3)
In this case, the function f (x) is said to be even and decomposes in a cosine series ( b n=0 ) .
The graph of an even function is symmetrical about the Y axis. The function f in equation (2) is a
continuous function, so that f can be approximated by using the function T which is a function of
the Fourier cosine series, where:
K
1
T  t   a0  bt   ak cos kt
2 k (4)
Y  f  X  
(5)

X is a nonparametric component with


X  X i1 , X i 2 ,..., X im , so that

Y1 f ( X 11 , X 12 , … , X 1 m ) ε1


Yn [] [
Y = Y 2 ; f ( X )=

] []
f ( X 21 , X 22 , … , X 2 m )

f ( X n 1 , X n 2 , … , X nm )
∧ε= ε 2

εn

f  X ij 
The function can be approximated using a Fourier series so that it becomes:

K
1
f  X ij    0  b j X ij    ik cos kX ij
2 k 1 (6)
with,
I = 1,2,…,n : n = number of observations
j = 1,2,…,m : m = number of independent variables
k = 1,2,…,K : K = sum of fourier coefficients
α 0 ,α k , b = parmeters in the model

The Fourier series regression model in equation (6) when substituted in equation (5), it is obtained:

Y  X  (7)
1 X 11 cos X 11 cos 2 X 11  cos KX 11 X 12 cos X 12 cos 2 X 12 cos KX 12  X 1m cos X 1m cos 2 X 1m  cos KX 1m 
1 X 21 cos X 21 cos 2 X 21  cos KX 21 X 22 cos X 22 cos 2 X 22 cos KX 22  X 2 m cos X 2 m cos 2 X 2 m  cos KX 2 m 
X 
                 
 
1 X n1 cos X n1 cos 2 X n1  cos KX n1 X n 2 cos X n 2 cos 2 X n 2 cos KX n 2  X nm cos X nm cos 2 X nm cos KX nm 

T
   a0* b1 a11 a12  a1k b2 a21 a22  a2 k  bm am1 am2  amk 
1
a0*  a0
for 2
K K K
Yi   0  b1 X 1i    k 1 cos kX 1i b2 X 2i    k 2 cos kX 2i  b3 X 3i    k 3 cos kX 3i
k 1 k 1 k 1
K
 b4 X 4i    k 4 cos kX 4i
k 1

The estimator ̂ is obtained using the Least Square method as follows:

 T   Y  X   Y  X
T

 YT  T X T   Y  X  
 Y TY  Y T X    T X TY   T X T X 
 Y T Y  2 T X T Y   T X T X  (8)

To get an estimator ̂ , the value  T in equation (8), is reduced ̂ so that it is obtained

 T 
0
 . Equation (8) becomes:
2 X T Y  2 X T X ˆ  0
2 X T X ˆ  2 X T Y
X T X ˆ  X T Y
ˆ   X T X  X T Y
1

Determination of the Number of Fourier Coefficients (K)


One method that can be used to determine the number of Fourier coefficients (K optimal) is
Generalized Cross Validation (GCV). The GCV for the Fourier series is as follows:
MSE
GCV 
n trace  I  H  X   
2
1

(9)
with,
n
2
MSE=n −1
∑ ( Y i−Y^ i )
i=1

The smallest GCV value will produce the K optimal value.


The Best Model Selection Criteria
According to Qudratullah (2013) there are 2 (two) information criteria that are often used,
namely Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC). 
 JKSm 
AICm  2 ln   2p
 n 
(10)
 JKS m 
BICm  2 ln    p ln n
 n 
(11)
where is,
JKSm  : the number of squares of error for the m model
n     : the number of sample data
p     : the number of parameters of the m model
The best model that can be chosen is the model that gives the minimum AIC or BIC value.
The steps taken in this research are as follows:
1) Make a scatter plot to find out patterns and estimation equations regarding the relationship
between two variables;
2) Determining the Fourier coefficient (K optimal) value which is neither too large nor too
small so that it will produce function estimator curve f a good;
3) Estimating the parameters of the Fourier series regression model using the OLS method;
4) Creating a Fourier Series Nonparametric Regression Model;
5) Selecting the best model using information criteria, namely Akaike Information Criterion
(AIC) and Bayesian Information Criterion (BIC) which have a minimum value;
6) Application of the best model on rainfall data.

Research Data
The object in this study is secondary data obtained from data from the annual publication
report of the Central Statistics Agency (BPS) of West Java Province which contains a complete
statistical description of the geographical, climatic, economic, social conditions in West Java
Province, and so on. The data used by the author in this study is about rainfall data by month in
West Java Province in 2015-2019 and several predictor variables which are factors that influence
rainfall. Dependent variable of the amount of rainfall by month in West Java Province (mm 3) such
as Average Air Humidity (%) (X1), Average Air Pressure (mb) (X2), Average Wind Speed
(Km)/Hour) (X3), and Average Air Temperature (°C) (X4).

RESULTS AND DISCUSSION


Descriptive Statistics
Data used in this case is rainfall data by month in West Java Province in 2015-2019, with a lot
of data n = 60, the dependent variable is the amount of rainfall.

Figure 1. Graph of Total Rainfall Data


The average rainfall in West Java Province is 157,577 mm3 with a variance of 10757,515. The
average value of 157,577 mm3 shows that the amount of rainfall by month in 2015-2019 is the same
as for 60 months in West Java Province which is 157,577 mm 3 of the total rainfall in each month.
The high fluctuating variance value is quite high as indicated by July which has the lowest average
rainfall of 19,4 mm3 and November which has the highest average rainfall of 347,62 mm 3 in West
Java Province.
Table 1. Descriptive Statistics
Variabl
Mean Variance Minimum Maximum
e
Y 157,577 10757,515 19,4 347,62
X1 74,558 24,645 65,68 80,08
X2 924,425 0,228 923,8 925,22
X3 4,198 0,152 3,66 4,76
X4 4,453 0,082 24 24,98
Figure 2. Scatter Plot of Independent Variables

Rainfall Modeling in West Java Province Using Fourier Series


Estimation of the model using the Fourier Series approach can be obtained as follows:
K K
Yi   0  b1 X 1i    k1 cos kX 1i b2 X 2i    k 2 cos kX 2i
k 1 k 1
K K
 b3 X 3i    k 3 cos kX 3i b4 X 4i    k 4 cos kX 4i
k 1 k 1 (12)
In the nonparametric regression of the Fourier Series, it is very dependent on the Fourier
coefficient (K). A K larger value will result in a more complex model and the estimation curve will
follow the actual data pattern, so that the bias is smaller and the variance is larger. The K optimal
value that can be selected is the value K that produces a minimum GCV value. The results of the
analysis for the value are K given in the table below:
Table 2. GCV values for each Fourier Coefficient (K)
Value of Fourier Coefficient (K) GCV
1 380971,11
2 157097,28
3 82572,65
4 47686,17
5 31686,39
6 19305,72
7 10056,82
8 7632,17
9 5151,57
10 2882,89
11 1653,63
12 1027,73
13 549,92
14 256,73
15 1,034 x 10-6
16 2,686 x 10-3
17 1,869 x 10-3

It is necessary to look at the values MSE (Mean Square Error) and R2 for each K.
Table 3. MSE and R2 values for each K
Value of Fourier Coefficient (K) MSE R2
13 462,09 97,30%
14 239,90 98,60%
15 1,00074 x 10-6 100%

Based on the output results of R Studio 4.0.0 , the values are obtained in the Akaike
Information Criterion (AIC) and Bayesian Information Criterion (BIC) Fourier series nonparametric
regression model with K= 13, K= 14, and K= 15, the results are as follows:
Table 4. Results of Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC)
Values
Value of Fourier Coefficient (K) AIC BIC
13 101,7284 221,1061
14 111,0396 238,7946
15 157,6295 293,7619

Based on table 4. a nonparametric Fourier series regression model can be selected with the
values Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC) smallest so
that the selected Fourier series model is a Fourier series model with the number of K= 13.
Based on Table 2, the value of K= 13 produces a GCV value of 549,92. Nonparametric
regression Fourier series with K= 13 produces a value of R2 Amounting to 97,30%, which means
that the diversity of response values capable explained by the predictor variables of 97,30% .If the
value K= 13, then had to estimate the parameters as many as 57 parameters. Thus, the estimation of
the Fourier series nonparametric regression model for the model of the amount of rainfall in West
Java Province is given by:
Table 5. Parameter Value for K=13
Parameter Value Paramete Value Parameter Value
r
0 113685,36  42 -8,34  93 5824,75

b1 -6,84  52 -39,05 103 10230,40

11 46,34  62 53,82 113 8190,23

 21 -22,55  72 -117,50 123 3832,43

 31 23,58  82 -16,64 133 741,41


 41 74,80  92 23,05 b4 93,94

 51 -179,87 102 4,25 14 314,24

 61 20,68 112 87,23  24 -187,59

 71 26,06 122 -145,72  34 -213,57

81 -40,74 132 50,43  44 101,81

 91 154,33 b3 218,70  54 -280,65

101 -152,09 13 -32,85  64 23,09

111 -73,50  23 8954,64  74 -13,89

121 10,35  33 12481,80  84 -165,06

131 -167,99  43 5644,73  94 49,67

b2 -128,43  53 -7616,12 104 -41,04

12 -29,27  63 -17113,59 114 -163,78

 22 179,13  73 -15810,70 124 -35,24

 32 -105,36  83 -5420,20 134 -165,73

So that the nonparametric regression model of the Fourier series with obtained K= 13 is as follows:
Yˆ  113685,36  6,84x1  46, 34 cos x1  22, 55cos 2 x1  23, 58cos 3 x1  74,80 cos 4 x1
 179,87 cos 5 x1  20, 68 cos 6 x1  26, 06 cos 7 x1  40, 74 cos8 x1  154,33cos 9 x1
 152, 09 cos10 x1  73,50 cos11x1  10,35cos12 x1  167, 99 cos13 x1  128, 43x2
 29, 27 cos x2  179,13cos 2 x2  105,36 cos 3 x2  8,34 cos 4 x2  39, 05cos 5 x2
 53,82 cos 6 x2  117,50 cos 7 x2  16, 64 cos8 x2 +23, 05 cos 9 x2  4, 25 cos10 x2
 87, 23cos11x2  145,72 cos12 x2 +50, 43cos13 x2 +218, 70 x3  32,85cos x3
 8954, 64 cos 2 x3  12481,80 cos 3 x3 +5644, 73cos 4 x3  7616,12 cos 5 x3
 17113,59 cos 6 x3  15810, 70 cos 7 x3  5420, 20 cos8 x3 +5824, 75cos 9 x3
 10230, 40 cos10 x3  8190, 23cos11x3 +3832, 43cos12 x3  741, 41cos13 x3
 93, 94x4  314, 24 cos x4  187,59 cos 2 x4  213, 57 cos 3 x4  101,81cos 4 x4
 280, 65cos 5 x4  23,09 cos 6 x4  13,89 cos 7 x4  165, 06 cos8x4  49, 67 cos 9 x4
 41, 04 cos10 x4  163,78cos11x4  35, 24 cos12 x4  165, 73cos13x4

Table 6. Original Data and Predicted Data with Fourier Series Nonparametric Regression Model
Year Y Yˆ Error
2020 207,6 247,37 -39,77
336,6 334,90 1,69
292,5 247,37 45,12
271,4 267,81 3,58
292,3 289,11 3,19
30,3 27,70 2,59
63,7 62,79 0,91
41,6 38,61 2,99
87,7 85,91 1,78
327,3 324,43 2,86
207,3 205,35 1,94
262,1 260,93 1,16

Line Graph of Original Data and Predicted Rainfall Data for West Java Province

Rainfall by Month in West Java Province


600
500

400
300

200

100

0
Aug-13 Dec-14 May-16 Sep-17 Feb-19 Jun-20 Oct-21
-100

Data Asli (Y) Data Prediksi (Ŷ)

Figure 3. Graph of Original Data with Predicted Data


Based on the graphs and predictions of the data obtained, it can be seen that the model can be
used to accurately predict the rainfall data for West Java Province. In the prediction data, the
obtained error by looking at the MSE (Mean Square Error) value of the model is 462,09 and the
coefficient of determination is 97,30%.

CONCLUSIONS AND RECOMMENDATIONS


Conclusions
Based on the analysis, several conclusions were obtained from this study, namely:
1. The best nonparametric Fourier series regression model for data on the effect of rainfall by
month in West Java Province in 2015-2019 is K= 13.
2. The level of model accuracy is evidenced by the Mean Square Error (MSE) value of the
Fourier series nonparametric regression model for the effect of rainfall by month in West
Java Province in 2015-2019 is 462.09 and the coefficient of determination is 97,30% so that
the model can be used for predicting rainfall data for West Java Province very accurately.
3. Air humidity (X1) and air pressure (X2) variables have a significant effect on rainfall.

Recommendations
For further research are:
1. The Fourier series model in this study is only limited to four independent variables, then it
can be developed with more than four independent variables or more than one response
variable (multi response variables).
2. There are still many choices of approach methods in nonparametric regression analysis that
can be done in estimating the regression curve, such as Orthogonal series, K-Nearest
Neighbor, Neural Networks and others.

REFERENCES
Chamidah, Nur. Buku Ajar Analisis Regresi Nonparametrik Menggunakan Program R. 2020.
Surabaya: Airlangga University.
Damanik, Asan. Fungsi-fungsi Khusus dilengkapi dengan Deret Fourier & Transformasi Integral.
2010. Yogyakarta: Graha Ilmu.
Mariati, N. P. A. M. Pemodelan Regresi Deret Fourier dan Spline Truncated dalam Regresi
Nonparametrik Multivariabel (Aplikasi: Data Kemiskinan di Provinsi Papua). 2015.
Surabaya.
Mariati, N. P. A. M., Budiantara, I. N., dan Ratnasari, Vita. Combination Estimation of Smoothing
Spline and Fourier Series in Nonparametric Regression. Journal of Mathematics. Vol. 2020.
1-10.
Octavanny, M.A.D.O., Budiantara, I.N., dkk. Nonparametric Regression Model for Longitudinal
Data with Mixed Truncated Spline and Fourier Series. Abstract and Applied Analysis. Vol.
2020, 1-11.
Prahutama, Alan. Model Regresi Nonparametrik dengan Pendekatan Deret Fourier Pada Kasus
Tingkat Pengangguran Terbuka di Jawa Timur. Proceedings of the National Statistics Seminar
at Diponegoro University. 2013. Semarang.
Qudratullah, M. F. Analisis Regresi Terapan: Teori, Contoh Kasus, dan Aplikasi dengan SPSS.
2013. Yogyakarta: Andi.
Serov, Valery. Fourier Series, Fourier Transform and their Applications to Mathematical Physics.
2017. Oulu: Springer International Publishing.
Suparti, Santoto, R., Prahutama, A., dan Devi, A. R. Regresi Nonparametrik. 2018. Ponorogo:
Wade Group National Publishing.

You might also like