1
$\begingroup$

There's a task requiring me to predict selling price of a product with provided external data containing historical purchasing prices and selling prices of competitors(positive correlated). Illustrations of BRENT(Competitor's), PURCHASING PRICES and ACTUAL SELLING PRICE are as follows:

ORIGINAL TIME SERIES

After filling NA values, I tried to make these time series stationary by $$ln(\frac{x_{t+1}}{x_t}+1)$$ and the stationary time series are illustrated as follows:

STATIONARY TIME SERIES

Then I made some moving windows whose sizes are all 6, indicating that each window contains data, including selling prices, of past 6 days. For each window, it had one response: selling price of the 7th day's. By moving the window, I could get a data set of 3-dimension: $(window\_num, window\_size=6, variable\_num=20)$, and the shape of response set is $(window\_num, 1)$.

With these preparations I started to fit the response set by corresponding data set. The model I used was Transformer implemented by Keras from an instance of its official site. The network's structure was as follows:

NETWORK STRUCTURE

After training for 500 epochs, loss and MAE were stable and MAE is illustrated as follows:

MAE

However, compared with the actual response and origin price, which are shown as follows:

FITTING AND PREDICTING OF STATIONARY RESPONSE

FITTING AND PREDICTING OF ORIGIN PRICE

The upper ones of these two plots are from fitting the training data, and the lower ones are predicting using validation data. It is shown that the outputs of my model converge to one straight line, and thus it could not seize any volatility of the response.

In another trial using NARX with MATLAB's NEURAL TIME SERIES, the series predicting result could be far more better (AT LEAST IT SOMEWHAT CATCHES THE TREND), so I considered the bad performance of my model was not caused by the data itself.

NARX RESULT

I have been confused for a couple of weeks, could anyone help? Thanks so much for your patience and assistance.

$\endgroup$
0
$\begingroup$

Before training your NN you applied a transformation. This means that the NN learned to predict the stationary process, not the original prices. You need to reverse this transformation in order to compare with prices.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Hi Akylas Stratigakos, I suppose that this transformation of stationarity can ensure the statistical stability of time series for fitting and forecasting? Still I will give it a try, thanks! $\endgroup$ – C. Augustus Sep 21 at 2:58
  • $\begingroup$ After 10000+ epochs my model predicting origin price series (without stationarity) still turned out to be one straight line, should be the average value of the average prices, and the loss could barely reduce. So hopeless... $\endgroup$ – C. Augustus Sep 21 at 3:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.