Open access peer-reviewed chapter

Perspective Chapter: Detecting Volatility Pattern of Assets Returns Using Wavelet Analysis

Written By

Okonkwo Chidi Ukwuoma, Ugo Donald Chukwuma and Titus Ifeanyi Chinebu

Submitted: 15 September 2023 Reviewed: 13 November 2023 Published: 22 December 2023

DOI: 10.5772/intechopen.1003903

From the Edited Volume

Modern Applications of Wavelet Transform

Srinivasan Ramakrishnan

Chapter metrics overview

75 Chapter Downloads

View Full Metrics

Abstract

This chapter advocates for the use of wavelet analysis as a potent tool in understanding the dynamic nature of asset price volatility in financial markets. While traditional methods like GARCH models have been valuable, wavelet analysis offers a distinctive approach by decomposing time series data into various scales and frequencies. This enables a comprehensive perspective, capturing both short-term fluctuations and long-term trends. In an era of interconnected and information-rich financial markets, the ability to discern subtle volatility patterns is crucial. The chapter provides a guide to wavelet analysis, explaining its foundations, principles, and methodology for application to financial time series. Real data from NASDAQ Composite, DOW Incorporated, S&P500, and Omnicell Inc. is used for illustration. The efficacy of wavelet analysis is emphasized, offering finance professionals, academia, and researchers a simple yet robust approach to navigate the complexities of modern financial markets, make informed decisions, and adapt to evolving conditions. The chapter aims to enhance understanding of financial market behavior, inspiring further research and innovation in financial analysis and risk management.

Keywords

  • volatility
  • wavelet analysis
  • wavelet coherence
  • continuous wavelet transform
  • asset returns
  • stock market

1. Introduction

The dynamic landscape of the financial markets is very volatile, and the concept of volatility plays a pivotal role in the financial market [1, 2]. Volatility, often referred to as the degree of variation in asset prices over time, serves as a fundamental indicator for investors, traders, and risk managers [3, 4]. Accurate assessment of volatility patterns is important in making informed decisions, managing risk exposure, and optimizing investment strategies [5]. While traditional methods of volatility measurement, such as the generalized autoregressive heteroskedasticity (GARCH) models, have provided valuable insights, the complexity and nuances of market behaviors demand more alternative and more comprehensive approaches to volatility analysis [6, 7, 8, 9]. In [10], the authors analyzed the multifractal properties of the US and European stock markets to identify patterns in investor sentiment.

This chapter seeks to look at an alternative approach to volatility analysis through the use of wavelet analysis. Wavelet analysis is a powerful mathematical tool that allows us to explore the temporal dynamics of volatility patterns with a level of detail that traditional methods cannot easily achieve. By decomposing financial time series data into different scales and frequencies, wavelet analysis offers a richer perspective on market behavior that captures both short-term fluctuations and long-term trends [11, 12, 13].

As the financial landscape becomes increasingly interconnected and information-rich, the ability to detect and interpret subtle volatility patterns becomes important. The chapter aims to provide a comprehensive understanding of wavelet analysis as a tool for uncovering these patterns and extracting meaningful insights from complex financial data. We will explore the foundations of volatility measurement, discuss the principles of wavelet analysis, delve into the methodology of applying wavelets to financial time series, and exemplify the approach using real data from the stock market.

Through this exploration, readers will gain a deeper appreciation of the power of wavelet analysis in understanding the intricate dynamics of asset returns volatility. By embracing this simple yet robust approach, finance, academia, and research professionals will be better equipped to navigate the complexities of modern financial markets, make informed decisions, and adapt to evolving market conditions.

Advertisement

2. Volatility in the financial market

The pattern of volatility in asset returns can provide insights into the risk and expected returns of the asset. The knowledge of volatility pattern is a great tool for investors as it helps them to know when to buy, sell, or hold their securities [1, 2, 6, 14]. There are certain stylized facts about assets return volatility. They are:

  1. Higher return volatility increases the probability of a bear market.

  2. Stocks with high volatility risk tend to have higher expected returns.

  3. When volatility increases, the equity and variance risk premiums fall or stay flat at short horizons despite the higher future risk.

  4. Volatility clustering is a well-known stylized feature of financial asset returns, and there may be an asymmetric pattern in volatility clustering.

  5. Increases in volatility positively forecast the variance risk premium at longer horizons.

Advertisement

3. Time domain and frequency domain analysis

Time domain analysis focuses on analyzing signals or mathematical functions in reference to time. It displays the changes in a signal over a span of time. It is commonly visualized using graphs or plots that show the signal’s behavior over time. It provides insights into the temporal characteristics and dynamics of the signal. It is useful for studying the behavior of asset returns over different time periods. It can capture trends, patterns, and fluctuations in the returns over time [4, 5].

Frequency domain analysis, on the other hand, analyzes signals or mathematical functions in reference to frequency. It provides information about the distribution of signal energy across different frequencies. It is commonly visualized using tools, such as spectrum analyzers or frequency response plots. It helps to identify the presence of specific frequencies or frequency components in the signal. It is useful for studying the periodicity, cycles, and spectral characteristics of asset returns. It can reveal information about the dominant frequencies or frequency bands that contribute to the returns [14, 15].

3.1 Key differences between time and frequency domain

Representation: Time domain analysis represents signals in the time dimension, while frequency domain analysis represents signals in the frequency dimension.

Visualization: Time domain analysis is commonly visualized using graphs or plots of signal amplitude versus time, while frequency domain analysis is visualized using tools, such as spectrum analyzers or frequency response plots.

Focus: Time domain analysis focuses on the temporal behavior and changes in the signal, while frequency domain analysis focuses on the distribution of signal energy across different frequencies.

Insights: Time domain analysis provides insights into the temporal characteristics and dynamics of the signal, while frequency domain analysis provides insights into the spectral characteristics and frequency components of the signal.

Applications: Time domain analysis is useful for studying trends, patterns, and fluctuations over time, while frequency domain analysis is useful for studying periodicity, cycles, and spectral properties.

In the context of asset returns, time domain analysis helps understand the temporal behavior and patterns of returns, while frequency domain analysis helps identify dominant frequencies or cycles that contribute to the returns. Both approaches have their own advantages and can provide valuable insights into the characteristics of asset returns.

Advertisement

4. Wavelet analysis

Wavelet analysis is a tool that utilizes wavelets, which are mathematical functions to represent a signal in a localized and adaptable manner. It has the ability to capture the signal dynamics and identify the patterns and features in both time and frequency domains.

The capacity to evaluate time series data with nonstationary (changing over time) characteristics is a key benefit of wavelet analysis. This makes it practical for a variety of applications, including denoising, signal compression, and image and audio compression.

Numerous applications, including banking, biomedicine, engineering, and geophysics, have used wavelet analysis. It has been used in finance to evaluate financial time series data, including stock prices, to spot market patterns and trends. It can be used in biomedicine to examine physiological signals, such as brain activity and electrocardiograms. It can be used to analyze data in geophysics, such as seismic waves.

The wavelet transform takes a signal and changes it into a form that brings up certain features of the series for analysis. It is a real-valued and square-integrable function ψL2R that satisfies the condition

ψτ,st=1sψtτs,sR+,τR.E1

Wheresin Eq. (1) is the scaling or dilation parameter andτ is a translation or position parameter. For a time series xt, its wavelet is oscillatory (goes up and down) that isψxtdx=0. It is integrable, that is, ψxtdx<. It also satisfies the admissibility condition.

A wavelet ψL2R is said to be admissible if its Fourier transform, Fxt=ψuei2πuxtdu, satisfy Cψ=Fxt2xtdx where 0<Cψ<.

4.1 Continuous wavelet transform (CWT)

The CWT is given as

Wxus=xt1sψtusdtE2

In Eq. (2), Wxus is simply a projection of a chosen wavelet on a time series. It is also the wavelet coefficient of the time series x. It is possible to reconstruct the decomposed CWT to recover the time series using

xt=1Cψ0Wxusψu,stdudss2,s0E3

Provided Cψ satisfies the admissibility condition. Continuous wavelet transforms have a very high computational cost.

4.2 Wavelet coherence

Coherence is analog to classical correlation. To identify both frequency bands and time intervals when two signals are related, wavelet coherence is used. Given signal X(t); Y(t), their wavelet coherence is defined as

Rx,y2sτ=Ss1Wx,ysτSs1Wx2×Ss1Wy2,0Rx,ysτ1E4

where S in (4) is a smoothing operator defined as SW=SscaleStimeWs, where Sscaledenotes smoothing along the wavelet scale axis and Stime smoothing in time [16]. and is dependent on the choice of mother wavelet. Values of the wavelet coherence close to zero indicate weak correlation, while values close to one show evidence of strong correlation.

Advertisement

5. Implementation of wavelet analysis in R

Several R packages are available for the implementation of wavelet analysis in R. Some of the packages and their descriptions:

  1. WaveletGARCH: This package is used to fit the Wavelet-GARCH Model to Volatile Time Series Data.

  2. Wavelets—This package provides functions for computing wavelet filters, wavelet transforms, and multiresolution analyses. It also includes functions for plotting wavelet transform filters.

  3. WaveletComp—This package provides functions for wavelet analysis and reconstruction of time series, cross-wavelets, and phase difference. It also includes functions for significance with bootstrap algorithms.

  4. Waveslim—This package provides functions for wavelet-based signal processing, including denoising, compression, and signal reconstruction. It also includes functions for wavelet-based time series analysis and visualization.

  5. Wavethresh—This package provides functions for wavelet thresholding, including hard, soft, and adaptive thresholding. It also includes functions for wavelet-based denoising and signal reconstruction.

  6. WaveletML: This package decomposes time series into different components which helps to capture volatility at multi resolution level by various models. Then it uses Machine Learning models (Artificial Neural Network and Support Vector Regression have been used) is used for data predictions.

  7. WaveletANN: This package wavelet and ANN technique to de-noise data and make forecast.

  8. Biwavelets—This package provides functions for wavelet analysis for univariate and bivariate wavelet analysis.

These R packages provide a range of functions for wavelet analysis, including continuous wavelet transform, wavelet coherence, wavelet cross-spectrum, wavelet packet transforms, and wavelet variance stabilization. They also provide functions for plotting wavelet transform filters and significance with bootstrap algorithms. These packages can be useful for detecting volatility patterns in financial returns and analyzing signals or functions in both the time and frequency domains.

Advertisement

6. Algorithm for implementation of wavelet analysis

  1. Collect data

  2. Clean the data

  3. Compute the descriptive statistics

  4. Get the returns of the data

  5. Ensure the length of the data is of the power 2n

  6. Compute and plot the continuous wavelet transform of the returns of the stock

  7. vii Compute and plot the wavelet coherence

  8. Interpret the result

Advertisement

7. DATA and data analysis

The data utilized for the example are from NASDAQ Composite (NASDAQ), DOW Incorporated (DOW), S&P500 (SP500), and Omnicell Inc. (OMCL). Sourced from Yahoofinance.com from August 8, 2019 to September 1, 2023. We first compute the stock price returns and then follow all the steps in the algorithm as outlined above.

Advertisement

8. Result and interpretation of result

From the summary statistics in Table 1, it can be seen that the standard deviation measures the dispersion of the data around the mean. The higher the standard deviation, the more volatile the instrument is. Looking at the standard deviation of the four stocks, we can see that DOW has the highest standard deviation of 5881.868, followed by NASDAQ with 3312.895, SP500 with 828.6003, and OMCL with 38.96592. Therefore, we can say that DOW is the most volatile stock, followed by NASDAQ, SP500, and OMCL. In Table 2, we observe that the standard deviation of the returns shows that the OMCL returns are the most volatile followed by NASDAQ, SP500, and DOW. These results show that a stock could be highly volatile while its returns are not.

SP500DOWNASDAQOMCL
Mean3160.18126664.389182.50574.36086
Median2919.3526213.18070.1267.21
Mode4354.1717924.247208.1743.05
Std Deviation828.60035881.8683312.89538.96592
Kurtosis−1.22743−1.15351−1.178950.121511
Skewness0.29609−0.075480.3544910.990368
Minimum1833.415691.624218.8125.45
Maximum4804.5136722.616120.92185
Count2011201120112011

Table 1.

Summary statistics of the stock price.

SP500rDOWrNASDAQrOMCLr
Mean0.0004370.0002840.000565−0.0002
Median0.0011910.0007560.0019130.000177
Mode0.0117730.009560.0094980
Std_Dev0.0118560.0116470.0161030.027882
Kurtosis6.80070814.203345.78157927.42
Skewness−0.50498−0.58657−0.55666−2.01229
Minimum−0.07141−0.10353−0.09504−0.34406
Maximum0.0603430.0815740.0688630.140509

Table 2.

Summary statistics of the stock price return.

The time series plot in Figures 14 indicates that market forces were dominant, as evidenced by the movement of the stocks. They all reached their lowest point simultaneously, as shown by the light blue oval highlighter. In the same vein, they also experience their peak at the same period as highlighted by the light-yellow rectangles. In between these two periods, the stock price rose consistently until it reaches its peak, they all took a downward move. While the others were struggling to stay afloat, OMCL took a nose dive to a very low point (Figures 58).

Figure 1.

Time series plot of SP500.

Figure 2.

Time series plot of DOW.

Figure 3.

Time series plot of NASDAQ.

Figure 4.

Time series plot of OMCL.

Figure 5.

Time series plot of SP500. Returns.

Figure 6.

Time series plot of DOW returns.

Figure 7.

Time series plot of NASDAQ returns.

Figure 8.

Time series plot of OMCL returns.

The stock returns indicate that the point of highest volatility (with the highest width shown by the green oval) occurred in the same period for all stock returns except OMCLr whose highest volatility occurs at the point shown by the pink highlight.

The continuous wavelet transform (cwt) attempts to capture the volatility of the stock return in time and frequency domain. The color indicates the intensity of the volatility in any given region. The colder colors (blue through green) indicate regions of low volatility, while the hot colors (yellow through red) indicate regions of high volatility. The x-axis captures the time domain while the y-axis(period) captures the frequency domain. The frequency domain goes from top (0) to bottom (256). The area covered by the cone-like shape is called the cone of influence. This is the region in which the values are statistically significant.

The cwt plots Figure 9 Continuous wavelet transform of SP500 returns. Figures 912 shows that the returns generally have a very high volatility in the low- frequency domain and low volatility in the high-frequency domain. The NASDAQ return seems to have a higher volatility spread at higher frequencies. This is followed by OMCL.

Figure 9.

Continuous wavelet transform of SP500 returns.

Figure 10.

Continuous wavelet transform of DOW returns.

Figure 11.

Continuous wavelet transform of NASDAQ returns.

Figure 12.

Continuous wavelet transform of OMCL returns.

The wavelet coherence (wtc) captures the comovement of two securities in time and frequency domain. It shows well their returns move together. The cooler color(blue) shows that the two returns have low comovement, while the hotter color(red) shows a very high comovement.

The wavelet coherence plots show that there is a very strong comovement between SP500r and DOWr Figure 13, as well as between SP500r and NASDAQr Figure 14 at almost all time and frequency (Figure 15). The comovement of DOWr and NASDAQr Figure 16 is very high except some island between the 250 and 600 in the time domain where there are interspersed with low volatility. The comovements of SP500r and OMCLr, DOWr and OMCLr, as well as NASDAQr and OMCLr are generally low with flashes of spots with high volatility. The implication of this for investors is that in creating portfolio, one should avoid securities with very high comovement. This is to hedge the portfolios from ruin should there be a downturn in the market (Figures 17 and 18).

Figure 13.

Wavelet coherence of SP500r and DOWr.

Figure 14.

Wavelet coherence of SP500r and NASDAQr.

Figure 15.

Wavelet coherence of SP500r and OMCLr.

Figure 16.

Wavelet coherence of DOWr and NASDAQr.

Figure 17.

Wavelet coherence of DOWr and OMCLr.

Figure 18.

Wavelet coherence of NASDAQr and OMCLr.

Advertisement

9. Conclusion

In this chapter, we looked at the application of wavelet analysis as a tool to study the volatility pattern of stock price and its return. The advantages of using wavelet, which has the capability of uncovering the time, as well as the frequency properties of the security are highlighted. We demonstrated the application using four stocks SP500, DOW, NASDAQ, and OMCL. We computed the stock returns and named them SP500r, DOWr, NASDAQr, and OMCLr. The continuous wavelet transforms and the wavelet coherence were computed and their heatmap plotted.

The result of the continuous wavelet transforms shows that all the stock returns have a very high volatility at low frequencies but low volatility at high frequencies. This implies that investing in the short horizon will experience low volatility, while investing in the long horizon will experience very high volatility.

The wavelet coherence, which is a measure of the comovement of the two securities in time and frequency domain captures an interesting pattern. The wavelet coherence plots show that there is a very strong comovement between SP500r and DOWr Figure 13, as well as between SP500r and NASDAQr Figure 14 at almost all time and frequency. The comovement of DOWr and NASDAQr Figure 16 is very high except some region between the 250 and 600 in the time domain where there are interspersed with low volatility. The comovements of SP500r and OMCLr, DOWr and OMCLr, as well as NASDAQr and OMCLr are generally low with flashes of spots with high volatility.

Our findings underscore the power of wavelet analysis in capturing both short-term fluctuations and long-term trends in asset prices. We have shown that, while stock price returns exhibit high volatility at low frequencies, their volatility diminishes at higher frequencies. This discovery has significant implications for investors, highlighting the potential advantages of considering investment horizons when making financial decisions.

Moreover, our investigation into wavelet coherence has revealed the intricate relationships between different securities, uncovering instances of strong comovement and periods of divergence. These insights are invaluable for portfolio diversification strategies, emphasizing the importance of selecting securities with low comovement to mitigate risk.

As financial markets continue to evolve and become increasingly complex, the need for advanced analytical tools, such as wavelet analysis, becomes ever more apparent. Wavelet analysis equips professionals in finance, academia, and research with a powerful means to navigate these complexities, make informed decisions, and adapt to ever-changing market conditions.

In conclusion, the application of wavelet analysis has illuminated the nuances of financial market behavior, offering a deeper understanding of volatility patterns, comovements, and the interplay between time and frequency. By embracing this analytical approach, we arm ourselves with the knowledge and tools needed to thrive in the intricate landscape of modern financial markets.

References

  1. 1. Akdeniz L, Salih AA, Ok ST. Are stock prices too volatile to be justified by the dividend discount model? Physica A: Statistical Mechanics and its Applications. 2007;376:433-444
  2. 2. Alaali F. The effect of oil and stock price volatility on firm level investment: The case of UK firms. Energy Economics. 2020;87:104731
  3. 3. Blau BM, Whitby RJ. Gambling activity and stock price volatility: A cross-country analysis. Journal of Behavioral and Experimental Finance. 2020;27:100338
  4. 4. Liu F, Umair M, Gao J. Assessing oil price volatility co-movement with stock market volatility through quantile regression approach. Resources Policy. 2023;81:103375
  5. 5. Ruslan SMM, Mokhtar K. Stock market volatility on shipping stock prices: GARCH models approach. The Journal of Economic Asymmetries. 2021;24:e00232
  6. 6. Chan YT, Qiao H. Volatility spillover between oil and stock prices: Structural connectedness based on a multi-sector DSGE model approach with Bayesian estimation. International Review of Economics & Finance. 2023;87:265-286
  7. 7. Yuan X, Jin L, Lian F. The lead–lag relationship between Chinese mainland and Hong Kong stock markets. Physica A: Statistical Mechanics and its Applications. 2021;574:125999
  8. 8. Lin Y, Lin Z, Liao Y, Li Y, Xu J, Yan Y. Forecasting the realized volatility of stock price index: A hybrid model integrating CEEMDAN and LSTM. Expert Systems with Applications. 2022;206:117736
  9. 9. Chen Y, Qiao G, Zhang F. Oil price volatility forecasting: Threshold effect from stock market volatility. Technological Forecasting and Social Change. 2022;180:121704
  10. 10. Schadner O. On the persistence of market sentiment: A multifractal fluctuation analysis. Physica A: Statistical Mechanics and its Applications. 2021;581:126242
  11. 11. Osu B, Okonkwo C, Uzoma P, Akpanibah E. Wavelet analysis of the international markets: A look at the next eleven (N11). Scientific African. 2020;7:e00319
  12. 12. Liu J, Chen J, Zhengxun T. Detecting stock market turning points using wavelet leaders method. Physica A: Statistical Mechanics and its Applications. 2021;565:125560
  13. 13. Nafisi-Moghadam M, Fattahi S. A hybrid model of VAR-DCC-GARCH and wavelet analysis for forecasting volatility. Engineering Proceedings. 2022;18(1):6
  14. 14. Okonkwo C, Osu B, Uchendu K, Chibuisi C. Wavelet analysis of stocks in the Nigerian capital market. Nigerian Annals of Pure and Applied Science. 2019;2:176-183
  15. 15. Okonkwo CU, Osu BO, Chighoub F, Oruh BI. The co-movement of bitcoin and some African currencies – A wavelet analysis. Journal of Research in Emerging Markets. 2021;3(3):81-93
  16. 16. Grinsted A, Moore JC, Jevrejeva S. Application of the cross wavelet transform and wavelet coherence to geophysical time series. Nonlinear Processes in Geophysics. 2004;11:561-566

Written By

Okonkwo Chidi Ukwuoma, Ugo Donald Chukwuma and Titus Ifeanyi Chinebu

Submitted: 15 September 2023 Reviewed: 13 November 2023 Published: 22 December 2023