Analysis and Prediction about Yields Rate of Security Investment Based on R Software

Lu Wang, Yingying ZhangAdvances 2013 · DOI

Abstract

With the fantastic spurt of science and modern technology throughout the world, employing statistical techniques as the guidance of investment has become a new trend in finance field. R software is providing us a scientific platform for effective investment. Using R software as a basic tool, this paper discusses in detail about the normality hypothesis of yields rate which plays a significant role in the portfolio selection theory by Harry Markowitz. Firstly, we conduct normal distribution fitting of the hypothesis through line chart, histogram, curve of kernel density estimation, curve of empirical distribution function, and QQ chart. Secondly, we verify the normality hypothesis by the Shapiro-Wilk test and the Kolmogorov-Smirnov test. Finally we use the expectancy method and the exponential smoothing to make corresponding prediction, and arrive at the conclusion that the exponential smoothing is superior to the expectancy method.

Introduction

Harry Markowitz’s Nobel-winning Portfolio Selection Theory relies on a critical hypothesis: that security yields are random variables following a normal distribution. If this assumption is false, the mathematical models used to balance risk and return fall apart. However, many investors struggle to bridge the gap between this high-level theory and practical application. This paper addresses two main challenges: verifying the normality of specific market yields and identifying the most effective mathematical approach for predicting future yields to minimize risk.

Methods and Data

The researchers utilized R software to analyze 61 weeks of historical data from the Shanghai Composite Index. The analysis was conducted in two stages:

Normality Testing

To verify the distribution of yields, the study employed both visual and statistical methods. Visual analysis included histograms, Kernel Density Estimation (KDE), Empirical Distribution Functions (ECDF), and Q-Q plots. Mathematically, the Shapiro-Wilk and Kolmogorov-Smirnov tests were applied to provide rigorous p-values for the normality hypothesis.

Prediction Modeling

Two forecasting methods were compared:

  1. Expectancy Method: A simple arithmetic mean of the previous 56 weeks, assuming the future reflects the long-term historical average.
  2. Exponential Smoothing (ES): A weighted moving average where recent data points carry more weight. This model uses a smoothing constant ($\alpha = 0.1$) to react to recent market shifts.

The first 56 weeks served as the training set for parameter calculation and normality verification, while the final 5 weeks were used as a test set for prediction accuracy.

Results and Analysis

Verification of the Normality Hypothesis

Visual inspection of the yield distribution suggested a strong fit with the normal distribution. As shown in the histogram below, the density estimation curve closely follows the theoretical normal density curve.

Histogram and density estimation of yield rate p.

Statistical tests confirmed these observations. The Shapiro-Wilk test yielded a p-value of 0.6966, and the Kolmogorov-Smirnov test yielded 0.7796. Since both values significantly exceed the 0.05 significance threshold, the hypothesis that the Shanghai Composite Index yields follow a normal distribution is accepted.

Comparative Prediction Performance

The "Expectancy Method" proved insufficient for dynamic market conditions, predicting a near-static yield of approximately +0.0002. In contrast, Exponential Smoothing successfully tracked the actual market downturn.

Comparison of actual returns against Expectancy Method and Exponential Smoothing predictions.

As illustrated in the comparison plot, the Exponential Smoothing model (Predict_ES) produced values much closer to the actual market results than the static Expectancy Method (Predict_mean). This demonstrates that financial data possesses a "memory" where recent performance is a more reliable indicator of near-term future yields.

Conclusion

This study validates the normality assumption for the Shanghai Composite Index, supporting the application of Markowitz’s portfolio theory. Furthermore, it demonstrates that Exponential Smoothing is a superior tool for yield prediction compared to simple expectancy averages. While effective, future work should explore dynamic optimization of the smoothing constant ($\alpha$) and compare these results against more complex models like GARCH or ARIMA to further refine investment guidance.

Summary updated

Abstract

With the fantastic spurt of science and modern technology throughout the world, employing statistical techniques as the guidance of investment has become a new trend in finance field.R software is providing us a scientific platform for effective investment.Using R software as a basic tool, this paper discusses in detail about the normality hypothesis of yields rate which plays a significant role in the portfolio selection theory by Harry Markowitz.Firstly, we conduct normal distribution fitting of the hypothesis through line chart, histogram, curve of kernel density estimation, curve of empirical distribution function, and QQ chart.Secondly, we verify the normality hypothesis by the Shapiro-Wilk test and the Kolmogorov-Smirnov test.Finally we use the expectancy method and the exponential smoothing to make corresponding prediction, and arrive at the conclusion that the exponential smoothing is superior to the expectancy method.
BibTeX
@inproceedings{wang2013analysis,
  author = {Lu Wang and Yingying Zhang},
  title = {{Analysis and Prediction about Yields Rate of Security Investment Based on R Software}},
  booktitle = {Advances},
  year = {2013},
  doi = {10.2991/asshm-13.2013.31},
}
Figure