在研究了反向传播神经网络和 ARIMA 时间序列模型之后,我问自己哪个更好,但无法弄清楚答案。他们都对同一个问题(未来预测)使用不同的方法。请有人可以帮我说明显而易见的事情。
反向传播(C++):
typedef struct { /* A LAYER OF A NET: */
INT Units; /* - number of units in this layer */
REAL* Output; /* - output of ith unit */
REAL* Error; /* - error term of ith unit */
REAL** Weight; /* - connection weights to ith unit */
REAL** WeightSave; /* - saved weights for stopped training */
REAL** dWeight; /* - last weight deltas for momentum */
} LAYER;
typedef struct { /* A NET: */
LAYER** Layer; /* - layers of this net */
LAYER* InputLayer; /* - input layer */
LAYER* OutputLayer; /* - output layer */
REAL Alpha; /* - momentum factor */
REAL Eta; /* - learning rate */
REAL Gain; /* - gain of sigmoid function */
REAL Error; /* - total net error */
} NET;
阿里玛(R):
arima(stockadj,order=c(best.model[1],best.model[2],best.model[3]),xreg=1:n)
stockfor<-predict(stockari,h=100,newxreg=(n+1):(n+100))
ts.plot(stockadj,stockfor$pred,ylab="Original+Predicted Values",main="Forecast")