Research Article

Stock Prediction Based on Optimized LSTM and GRU Models

Table 5

Learning results of PCA-GRU.

Number of layersNumber of neuronsLook-back valueTrain MSETrain RMSETrain MAETest MSETest RMSETest MAETrain time

38101369.672737.009127.380029235.9590170.9853152.253872.1253
38202434.989549.345635.668312723.6592112.799293.6385168.9686
38302101.954145.847133.884734108.7148184.6854166.6717254.5802
38402574.525650.739837.520521786.1641147.6014127.3568333.7451
38501194.850534.566625.131229938.3730173.0271151.4763458.2760
28101196.423134.589323.042410500.0391102.469782.429054.2256
28202299.980247.958136.054229103.7676170.5983151.9113112.4777
28301426.401937.767726.662921631.0195147.0749121.6393167.5188
28401835.961842.848129.40479878.101699.388680.6860225.1572
28501503.736238.778026.767210440.7920102.180286.5779275.0539
31610943.231930.712121.840129209.2168170.9070148.9597116.7384
31620816.022628.566120.891512768.4766112.997799.0165255.2906
31630965.208131.067823.174714524.5684120.517999.9182815.1597
31640980.007231.305122.147712230.3311110.590884.34231096.2136
31650803.942028.353920.79949752.191498.753281.75051354.4110
21610776.476827.865319.34897601.507387.186674.742470.5103
21620784.206228.003721.068618093.4902134.5120119.4448176.9984
21630747.755327.345120.06758023.935189.576477.0783236.3435
21640720.655826.845019.340418241.6797135.0617117.5537378.0467
21650713.909426.719119.00319412.277397.016979.6811484.1664
33210453.667021.299515.65196122.331178.245361.3247469.7184
33220456.486821.365615.916911951.0684109.320990.6603977.3712
33230626.647225.032919.338411865.4746108.928886.89481483.5679
33240529.360423.007817.05539151.210995.662076.85831991.7930
33250504.711022.465816.904930787.4473175.4635153.60523289.7475
23210425.421020.625715.02016595.335981.211763.7287268.0692
23220653.841225.570318.744210183.2344100.912084.6054539.5263
23230508.943022.559816.23666050.969277.788061.9705856.6547
23240630.057525.100918.99567276.745685.303869.02451345.9522
23250623.701524.974018.07299594.841897.953380.54111678.2588

The number of epochs is 1000, learning rate is 0.001, and the activation function is .