Financial time series forecasting could be beneficial for individual as well as institutional investors. But, the high noise and complexity residing in the financial data make this job extremely challenging. Over the years, many researchers have used support vector regression (SVR) quite successfully to conquer this challenge. In this paper, an SVR based forecasting model is proposed which first uses the principal component analysis (PCA) to extract the low-dimensional and efficient feature information, and then uses the independent component analysis (ICA) to preprocess the extracted features to nullify the influence of noise in the features. Experiments were carried out based on 16 years’ historical data of three prominent stocks from three different sectors listed in Dhaka Stock Exchange (DSE), Bangladesh. The predictions were made for 1 to 4 days in advance targeting the short term prediction. For comparison, the integration of PCA with SVR (PCA-SVR), ICA with SVR (ICA-SVR) and single SVR approaches were applied to evaluate the prediction accuracy of the proposed approach. Experimental results show that the proposed model (PCA-ICA-SVR) outperforms the PCA-SVR, ICA-SVR and single SVR methods.
The endeavor of financial time series forecasting has gained extreme attention from both the individual and institutional investors because the accurate forecasting can influence the decision behind investment. This field is characterized by data intensity, noise, non-stationary, unstructured nature, high degree of uncertainty, and hidden relationships [
Technical analysis is a popular approach to study the capital market patterns and movement. The results of technical analysis may be a short or long-term forecast based on recurring patterns; however, this approach assumes that stock prices move in trends, and that the information which affects prices enters the market over a finite period of time, not instantaneously [
The first important step in developing an SVR based forecasting model is feature extraction (transforming the original features into new ones) and feature selection (choosing the most influential set of features). Principal component analysis (PCA) is a widely applied feature extraction method in the framework of SVR [
In this paper, an SVR based forecasting model is developed integrating both PCA and ICA to elevate the prediction accuracy for stock prices because even a small improvement of this performance can have a significant influence on investment decisions. Considering the fact that, technical analysis plays a vital role in the forecasting, it has been conducted to calculate technical indicators as the input features. Then PCA is used to extract the influential components from input features which are then filtered to transform the high-dimensional input into low-dimension features. After that, ICA is applied to convert the reduced features into independent components. The SVR then finally uses the filtered and transformed low-dimensional input variables to construct the forecasting model and predict stock prices for 1 to 4 days in advance. The predictive performance of the proposed approach is compared with three traditional approaches: the integration of PCA with SVR (PCA-SVR), ICA with SVR (ICA-SVR) and single SVR.
The reminder of this paper is organized into 6 sections. Section 2 provides a brief overview of the methodologies used in this study which includes PCA, ICA and SRV. Section 3 introduces the proposed method. Section 4 describes the research data. Section 5 reports the experimental results obtained from the study. Finally Section 6 contains the concluding remarks.
Principal component analysis (PCA), invented by Karl Pearson [
y i = U T x i (1)
where U is the m × m orthogonal matrix whose jth column uj is the jth eigenvector of the sample covariance matrix C = 1 n ∑ i = 1 n x i x i T . In other words, PCA solves the eigenvalue problem of Equation (2).
λ j u j = C u j , j = 1 , 2 , ⋯ , m (2)
where λ j is one of the eigenvalues of C. uj is the corresponding eigenvector. Based on the estimated uj, the components of yi are calculated as the orthogonal transformation of xi:
y i ( j ) = u j T x i , j = 1 , 2 , ⋯ , m (3)
The new components are called principal components. By using only the first several eigenvectors sorted in descending order of the eigenvalues, the number of principal components in yi can be reduced [
ICA is basically a signal processing technique that regains mutually independent but unknown source signals from their mixture without having any prior knowledge of the mixing mechanism. Let X = [ x 1 , x 2 , ⋯ , x m ] T be an m × n matrix which is a mixture of m source signals xi of size 1 × n, i = 1 , 2 , ⋯ , m . In basic ICA the above mixing model can be rewritten as [
X = A S = ∑ i = 1 m a i s i (4)
where ai is the ith column of the m × m unknown mixing matrix A and si is the ith row of the m × n source matrix S. The goal of the ICA is to estimate the un-mixing matrix W of size m × m that is used to transform the observed mixture signals X to yield the independent signals Y such that
Y = [ y i ] = W X (5)
where yi is the ith row of the matrix Y, i = 1 , 2 , ⋯ , m . The rows of Y are called the independent components (ICs) and are required to be statistically as independent as possible. Here, statistically independence means that the joint probability density of the components of Y is equal to the product of the marginal densities of the individual components. If the un-mixing matrix W is the inverse of the original mixing matrix A i.e. W = A−1, the latent source signals (si) can be estimated using the ICs (yi). For the identification of Equation (5), one fundamental requirement is that all the ICs, with the possible exception of one component, must be non-Gaussian.
Several algorithms have been developed to perform ICA modeling [
J G ( y ) ≈ [ E { G ( y ) } − E { G ( v ) } ] 2 (6)
where v is a standardized Gaussian variable and G is a non-quadratic function. G is given by G ( y ) = exp ( − y 2 / 2 ) in this study.
Two preprocessing steps are applied to the input matrix x to simplify the FastICA algorithm, centering and whitening [
The SVR extends the basic principles of Vapnik’s support vector machines (SVM) [
f ( x , w ) = w T x + b (7)
Vapnik’s linear ε-Insensitivity loss (error) function is:
| y − f ( x , w ) | ε = { 0 , if | y − f ( x , w ) | ≤ ε | y − f ( x i , w ) | − ε , otherwise (8)
Based on this, linear regression f ( x , w ) is estimated by simultaneously minimizing ‖ w ‖ 2 and the sum of the linear ε-Insensitivity losses as shown in Equation (10). The constant c controls a trade-off between an approximation error and the weight vector norm ‖ w ‖ , is a design parameter chosen by the user.
R = 1 2 ‖ w ‖ 2 + c ( ∑ i = 1 n | y − f ( x , w ) | ε ) (9)
Minimizing the risk R is equivalent to minimizing the following risk under the constraints mentioned in Equations (11)-(13).
R = 1 2 ‖ w ‖ 2 + c ∑ i = 1 n ( ξ + ξ * ) (10)
( w T x i + b ) − y i ≤ ε + ξ i (11)
y i − ( w T x i + b ) ≤ ε + ξ i * (12)
ξ i , ξ i * ≥ 0 , i = 1 , 2 , ⋯ , m (13)
Here, ξi and ξ i * are slack variables, one for exceeding the target value by more than ε and other for being more than ε below the target. As used in SVM, the above constrained optimization problem is solved using Lagrangian theory and the Karush-Kuhn-Tucker conditions to obtain the desired weight vector of the regression function.
SVR maps the input vectors x i ∈ R m into a high dimensional feature space ϕ ( x i ) ∈ H . A kernel function K ( x i , x j ) performs the mapping ϕ(.). The most popular kernel function that is used in this study is Radial Basis Function (RBF) as shown in Equation (14).
K ( x i , x j ) = exp ( − γ ‖ x i − x j ‖ 2 ) (14)
where γ is the constant of the kernel function. The RBF kernel function parameter γ and regularization constant C are the design parameters of SVR.
The three stage methodology named PCA-ICA-SVR proposed in this research scheme is depicted in
First of all, technical analysis is conducted on the dataset and 29 technical indicators (TIs) are calculated that are being used by financial experts [
As mention in Section 2.3, the RBF kernel function is incorporated in this study because it is the most widely used and well performing kernel function for forecasting purpose. But the performance of SVR is highly influenced by the selection of the parameters: γ and C. A very popular method to select the best values of these parameters is the grid search approach with cross-validation [
Feature | Description | Calculation Formula |
---|---|---|
10-day SMA | Simple 10-day moving average | ( 1 n ) ∑ i = t − n + 1 t C i , where Ct is the closing price. |
10-day EMA | Exponential 10-day moving average | EMA ( n ) t − 1 + α × ( C t − EMA ( n ) t − 1 ) , where α is a smoothing factor and α = 2 n + 1 |
10-day WMA | Weighted 10-day moving average | ( n ) C t + ( n − 1 ) C t − 1 + ⋯ + C t − n + 1 n + ( n − 1 ) + ⋯ + 1 |
A/D Oscillator | Accumulation/distribution oscillator. It is a momentum indicator that relates changes in price. | H t − C t − 1 H t − L t , where Lt is the low price and This the high price at time t. |
MACD | Moving Average Convergence/Divergence. | MACD ( n ) t − 1 + 2 n + 1 × ( DIFF t − MACD ( n ) t − 1 ) , where DIFF t = EMA ( 12 ) t − EMA ( 26 ) t |
Stochastic K% | Stochastic %K. It compares where a security’s price closed relative to its price range over a given period. | C t − L L t − ( n − 1 ) H H t − ( n − 1 ) − L L t − ( n − 1 ) × 100 , where LLt and HHt mean lowest low and highest high in the last t days, respectively |
Stochastic D% | Stochastic %D. Moving average of %K. | ∑ i = 0 n − 1 K % t − i 10 |
Momentum (close price) | It measures the amount that a security’s price has changed over a given time span. | C t − C t − 9 |
Larry William’s R% | Larry William’s R%. It is a momentum indicator that measures overbought/oversold levels. | H n − C t H n − L n × 100 |
Relative Strength Index (RSI) | Relative Strength Index. It is a price following an oscillator that ranges from 0 to 100. | 100 − 100 1 + ( ( ∑ i = 0 n − 1 U p t − i / n ) / ( ∑ i = 0 n − 1 D w t − i / n ) ) , where Upt means upward-price-change and Dwt means downward-price-change at time t. |
Close price ROC | Price rate-of-change. It is the difference between the current price and the price of n days ago. | C t C t − n × 100 |
CCI | Commodity Channel Index. It measures the variation of a security’s price. | ( M t − S M t ) ( 0.015 D t ) , where M t = ( H t + L t + C t ) / 3 , S M t = ∑ i = 1 n M t − i + 1 n and D t = ∑ i = 1 n | M t − i + 1 − S M t | n |
Disparity 5 | 5-day disparity. It is the distance of current two moving averages of a stock’s price. | C t M A 5 × 100 |
Disparity 10 | 10-day disparity. | C t M A 10 × 100 |
OSCP | Price oscillator. It is the difference between two moving average of a stock’s price. | M A 5 − M A 10 M A 5 |
γ) value pair. The (C, γ) value pair generating the minimum mean absolute percentage error (MAPE) is considered the best values for the parameters. The complete grid search is a time-consuming task. That’s why a coarse grid is used at first which identifies a better region on the grid. Then a finer grid search is conducted on that region.
Mean Absolute Percentage Error (MAPE), Mean Absolute Error (MAE), relative Root Mean Squared Error (rRMSE) and Mean Squared Error (MSE) are used to evaluate the performance of the proposed model. Formulas of these evaluation measures are shown in Equations (15)-(18) [
MAPE = 1 n ∑ t = 1 n | A t − F t | | A t | × 100 (15)
MAE = 1 n ∑ t = 1 n | A t − F t | | A t | (16)
rRMSE = 1 n ∑ t = 1 n ( A t − F t A t ) 2 × 100 (17)
MSE = 1 n ∑ t = 1 n ( A t − F t ) 2 (18)
where At is the actual value, Ft represent the predicted value and n is the total number of data points.
To conduct the study and evaluate the performance of the proposed approach, the 16 years’ historical data of daily transaction for the time period from January 2000 to December 2015 are collected from Dhaka Stock Exchange, Bangladesh (http://www.dsebd.org/). This data covers 3600 trading days and each data comprises five attributes: open price, high price, low price, close price and trade volume. We have considered three companies from three different sectors: Square Pharmaceuticals Limited, AB Bank Limited and Bangladesh Lamps Limited as these are the most prominent stocks in DSE. The daily closing prices of these companies are shown in Figures 2-4 respectively. The first one is a leading company in pharmaceuticals sector, the second leads the banking sector and the last one belongs to the engineering sector. 70% of the total sample points (around 2520 trading days) are used as the training sample and the remaining 30% of the total sample points (around 1080 trading days) are holdout to be used as the testing sample.
The principal component analysis on the original data shows that the first 10
components contribute over 98% cumulative covariance providing most information.
In this study, the radial basis function (RBF) is used as the kernel function of SVR. To find the best C and γ value pair we have considered e−5 to e10 for both parameters as our research space. For the data of Square Pharmaceuticals Limited, the coarse grid discovered the best (C, γ) as (e9, e3) with the 5-fold cross validation MAPE 2.23%. Then a finer grid search on the neighborhood of (e9, e3) produced a better cross-validation MAPE of 1.66% at (e9, e2.8). After the best (C, γ) is found the whole training set is trained again to generate the final SVR model. The best value pairs for C and γ for every prediction task where minimum prediction error is exhibited by the grid search approach are shown in
The forecasting results of the proposed PCA-ICA-SVR model are compared with single SVR model that uses all the original input variables, the PCA-SVR model where the filtered PCs are used as input variables by the SVR model and finally the ICA-SVR model where non-filtered ICs calculated from the original variables are used by the SVR model.
In all the cases, closing prices of the target stock are predicted for 1, 2, 3, and 4 days in advance. Prediction results for Square Pharmaceuticals Limited are listed in Tables 3-6. Tables 7-10 illustrate the comparative results of price forecasting for AB Bank Limited. Tables 11-14 compare the performance of price forecasting for Bangladesh Lamps Limited.
It is evident from all the results that, the proposed PCA-ICA-SVR model has produced lower MAPE (%), MAE, MSE and rRMSE (%) for all three target stocks. The integration of PCA and ICA improves the performance of SVR in most of the cases but the proposed PCA-ICA-SVR model outperforms other
Parameter | Square Pharmaceuticals Ltd. | AB Bank Ltd. | Bangladesh Lamps Limited. |
---|---|---|---|
C | e9.0 | e8.4 | e5.8 |
γ | e2.8 | e2.0 | e2.4 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 1.70 | 0.0170 | 3573.58 | 14.70 |
PCA-SVR | 1.95 | 0.0195 | 3947.96 | 23.11 |
ICA-SVR | 2.23 | 0.0223 | 5801.64 | 28.98 |
Single SVR | 1.98 | 0.0198 | 3864.83 | 33.97 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 2.12 | 0.0212 | 6865.01 | 18.04 |
PCA-SVR | 2.34 | 0.0234 | 7436.84 | 30.78 |
ICA-SVR | 2.68 | 0.0268 | 8479.62 | 37.70 |
Single SVR | 2.46 | 0.0246 | 7388.21 | 41.60 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 2.55 | 0.0255 | 11,435.36 | 19.42 |
PCA-SVR | 2.81 | 0.0281 | 12,358.35 | 36.03 |
ICA-SVR | 3.04 | 0.0304 | 13,575.35 | 35.82 |
Single SVR | 2.95 | 0.0295 | 12,331.95 | 47.27 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 3.05 | 0.0305 | 16,161.23 | 23.63 |
PCA-SVR | 3.28 | 0.0328 | 17,345.36 | 38.74 |
ICA-SVR | 3.36 | 0.0336 | 17,246.75 | 24.18 |
Single SVR | 3.32 | 0.0332 | 17,097.40 | 43.15 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 4.66 | 0.0466 | 900.50 | 20.16 |
PCA-SVR | 6.22 | 0.0622 | 1737.34 | 58.53 |
ICA-SVR | 5.46 | 0.0546 | 1530.14 | 74.01 |
Single SVR | 5.67 | 0.0567 | 1474.24 | 64.36 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 5.30 | 0.0530 | 1822.75 | 11.66 |
PCA-SVR | 6.65 | 0.0665 | 2740.14 | 21.76 |
ICA-SVR | 6.26 | 0.0626 | 2403.27 | 59.42 |
Single SVR | 6.19 | 0.0619 | 1474.24 | 64.36 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 5.84 | 0.0584 | 5638.42 | 22.06 |
PCA-SVR | 7.57 | 0.0757 | 7666.62 | 76.42 |
ICA-SVR | 6.32 | 0.0632 | 6302.39 | 87.78 |
Single SVR | 6.91 | 0.0691 | 7177.64 | 67.57 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 6.10 | 0.0610 | 8907.89 | 17.50 |
PCA-SVR | 8.00 | 0.0800 | 12,200.47 | 56.22 |
ICA-SVR | 6.67 | 0.0667 | 9155.54 | 78.69 |
Single SVR | 7.44 | 0.0744 | 11,675.15 | 52.66 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 3.35 | 0.0335 | 1680.07 | 43.68 |
PCA-SVR | 3.69 | 0.0369 | 2055.00 | 57.15 |
ICA-SVR | 4.05 | 0.0405 | 1922.19 | 83.90 |
Single SVR | 3.70 | 0.0370 | 2043.94 | 61.46 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 4.52 | 0.0452 | 3284.34 | 62.25 |
PCA-SVR | 4.68 | 0.0468 | 3803.27 | 71.93 |
ICA-SVR | 5.06 | 0.0506 | 3319.44 | 93.45 |
Single SVR | 4.81 | 0.0481 | 3859.30 | 81.16 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 4.66 | 0.0466 | 5033.45 | 46.49 |
PCA-SVR | 4.91 | 0.0491 | 5707.75 | 58.84 |
ICA-SVR | 5.05 | 0.0505 | 5006.75 | 67.41 |
Single SVR | 4.94 | 0.0494 | 5668.56 | 61.32 |
Prediction models | Performance measures | |||
---|---|---|---|---|
MAPE (%) | MAE | MSE | rRMSE (%) | |
PCA-ICA-SVR | 6.77 | 0.0677 | 6596.20 | 96.67 |
PCA-SVR | 6.89 | 0.0689 | 7712.17 | 108.01 |
ICA-SVR | 7.16 | 0.0716 | 6852.73 | 117.38 |
Single SVR | 6.89 | 0.0689 | 7619.66 | 110.77 |
three compared methods. This corroborates that the proposed PCA-ICA-SVR approach can generate lower prediction errors than other three compared approaches. Again, it could be noticed from the results that, the forecasting performance of all the approaches decreases as the predictions are made for more and more number of days in advance, which may be obvious for any prediction system.
The robustness of the proposed PCA-ICA-SVR method is evaluated by comparing its performance with PCA-SVR, ICA-SVR and single SVR methods using different ratios of training and testing sample sizes. The performance is compared in terms of MAPE (%) and rRMSE (%) with four relative ratios, 60%, 70%, 80%, and 90% of training sample size with respect to the complete dataset size. Predictions are made for the closing price of the target stock for next trading day.
This paper proposes a price forecasting model integrating PCA and ICA with SVR for financial time series. This PCA-ICA-SVR model first uses the PCA to extract the most influential components from the input features in order to overcome the over-fitting or under-fitting challenge caused by the noisy nature of financial time series data. The filtered PCs are then processed by ICA to estimate ICs which are finally used in SVR with RBF kernel function as input variables. The grid search for the best kernel parameters is conducted to improve SVR’s performance. The experiments have evaluated 16 years’ data for three commencing stocks from Dhaka Stock Exchange, Bangladesh. The performance of proposed model is compared with PCA-SVR, ICA-SVR and single SVR for short time durations (1 to 4 days) in terms of prediction error. Experiment results show that the proposed PCA-ICA-SVR model outperforms all three other methods by generating less predictive errors. The empirical results can conclude that the PCA and ICA, working together, can successfully unfold the influential
Relative Ratio (%) | Models | Square Pharmaceuticals Limited | AB Bank Limited | Bangladesh Lamps Limited | |||
---|---|---|---|---|---|---|---|
Testing MAPE (%) | Testing rRMSE (%) | Testing MAPE (%) | Testing rRMSE (%) | Testing MAPE (%) | Testing rRMSE (%) | ||
60 | PCA-ICA-SVR | 1.85 | 18.82 | 4.89 | 6.37 | 3.40 | 18.61 |
ICA-SVR | 2.47 | 30.11 | 6.03 | 98.82 | 3.80 | 80.78 | |
PCA-SVR | 2.18 | 40.26 | 6.31 | 19.08 | 3.84 | 47.00 | |
Single SVR | 2.16 | 43.84 | 5.98 | 43.85 | 3.86 | 70.36 | |
70 | PCA-ICA-SVR | 1.70 | 14.70 | 4.66 | 20.16 | 3.35 | 43.68 |
ICA-SVR | 2.23 | 28.98 | 5.46 | 74.01 | 4.05 | 83.90 | |
PCA-SVR | 1.95 | 23.11 | 6.22 | 58.53 | 3.69 | 57.15 | |
Single SVR | 1.98 | 33.97 | 5.67 | 64.36 | 3.70 | 61.46 | |
80 | PCA-ICA-SVR | 1.71 | 12.39 | 4.91 | 8.09 | 3.40 | 3.15 |
ICA-SVR | 2.24 | 20.47 | 5.31 | 59.13 | 3.74 | 60.91 | |
PCA-SVR | 1.99 | 20.59 | 6.40 | 10.37 | 3.75 | 22.60 | |
Single SVR | 2.07 | 31.60 | 5.31 | 27.02 | 3.59 | 34.10 | |
90 | PCA-ICA-SVR | 2.04 | 5.08 | 5.17 | 1.59 | 3.28 | 8.88 |
ICA-SVR | 2.62 | 16.39 | 5.96 | 50.03 | 3.56 | 42.74 | |
PCA-SVR | 2.13 | 12.25 | 6.57 | 4.59 | 3.71 | 17.08 | |
Single SVR | 2.19 | 19.31 | 5.77 | 26.61 | 3.70 | 35.25 |
information from the original data and uplift the performance of SVR in stock price forecasting. As the proposed model helps to predict stock prices with less error, investors can use this to gain more profit or obtain less loss in stock market. Again, this proposed approach can also be used in other domains like weather forecasting, energy consumption forecasting or GDP forecasting.
Future research may integrate Kernel PCA, non-linear ICA and other signal processing techniques like wavelet transformation with SVR to further enhance the forecasting performance. This study mainly focuses on short-term price prediction. Its applicability might be investigated for long-term forecasting in future and appropriate methods could be integrated to enhance performance in future. However, only the price related historical data is used here to predict future prices. But, it is well known that various other aspects like general economic conditions, government policies, company performance, investor’s interest etc. also play vital roles in stock market. In future, these aspects can also be incorporated as input features for prediction which may buttress the accurate prediction.
Chowdhury, U.N., Chakravarty, S.K. and Hossain, Md.T. (2018) Short-Term Financial Time Series Forecasting Integrating Principal Component Analysis and Independent Component Analysis with Support Vector Regression. Journal of Computer and Communications, 6, 51-67. https://doi.org/10.4236/jcc.2018.63004
ANN Artificial neural networks
ARIMA Autoregressive integrated moving average
CCI Commodity channel index
DSE Dhaka stock exchange
EMA Exponential moving average
GDP Gross domestic product
ICA Independent component analysis
IC Independent component
MACD Moving average convergence/divergence
MAE Mean absolute error
MAPE Mean absolute percentage error
MSE Mean squared error
PCA Principal component analysis
PC Principal component
RBF Radial basis function
ROC Rate-of-change
rRMSE Relative root mean squared error
RS Rough set
RSI Relative strength index
SMA Simple moving average
SVM Support vector machine
SVR Support vector regression
WMA Weighted moving average