4
$\begingroup$

I'm looking for the best method to normalize/standardize financial prices in order to use them as inputs for my neural network. As you probably know financial prices do not follow a normal distribution and you can't even know the max or min needed for the normalization as in the test set there could be a price higher or lower than the ones in the training set.

So I thought that I could standardize my datas trough a rolling window so the price standardized at time $t$ is computed as: \begin{equation} p'_{t}=\frac{p_{t}-E(p_{t-k:t})}{\sigma(p_{t-k:t})} \end{equation}

where with $p_{t-k:t}$ I mean succession of prices within the window of length k (from the period t-k to t)

Does it make sense? Is there any reasearch that I could study in deep? I've found the adaptive normalization method but it's too advanced for what I have to do (my goal is not to predict prices, so it's just an input variable that could help the model)

$\endgroup$
2
  • $\begingroup$ What exactly is Pt - k:t, is that a rolling window within the data? $\endgroup$ Aug 24, 2020 at 17:40
  • $\begingroup$ Yes, just edited $\endgroup$
    – unter_983
    Aug 24, 2020 at 17:42

2 Answers 2

4
$\begingroup$

Financial prices are, in general, not stationary. However, for a number of theoretical and empirical reasons we do think that log-returns (differences of $\log($prices$)$) are closer to stationary. Often, they are considered "close enough" to allow inference. The one exception to prices not being close to stationary might be prices which tend to be mean-reverting due to industrial production changing slowly: commodity prices, for example.

There is a major caveat to all this, however: we know that prices and log-returns of all assets (including commodities) exhibit persistent and time-varying variance. The correction is to model the conditional variance of log-returns using something like a GARCH model.

You may not need to use a GARCH model to get usable inferences; however, you should definitely be working with log-returns. I have seen enough presentations (in industry and academia) ended on the opening slide when somebody did not use log-returns. Even using standard returns often earns some skepticism.

$\endgroup$
4
  • $\begingroup$ Yes, I know in fact I already use log-returns as an input variable. But daily prices offer different values as the maximum price or the minimum price: what to do to insert even those variables in a neural net? Do you mean I have to use log-returns for each type of price (i.e. log-returns of the time series of max prices ...)? $\endgroup$
    – unter_983
    Aug 25, 2020 at 6:11
  • $\begingroup$ You could maybe use something different, but that would depend on what you are trying to estimate since there are only a few instances where using something else is justifiable. $\endgroup$
    – kurtosis
    Aug 25, 2020 at 18:14
  • $\begingroup$ I'm working on a reinforcement learning model for trading with a DQN, and I would like to include even maximum/minimum price as inputs $\endgroup$
    – unter_983
    Aug 25, 2020 at 18:44
  • $\begingroup$ Depending on how you structure your other inputs, you could specify the max and min as prices (probably troublesome) or as log-returns versus the opening price or last price (more useful when comparing to volatility estimates). $\endgroup$
    – kurtosis
    Aug 25, 2020 at 18:47
3
$\begingroup$

There is no one right answer as how to normalize data. I found this good article by Nayak et al. (2014) that give different normalization techniques for financial time series data. I haven't seen your specific technique before. In general I think the issue is that while you account for the data loss of a normal min/max normalization with the lokal window $k$, over long periods of time, you have the same issue as min/max that your data can grow outside of the window. I personally would start with z-score normalization (described in Nayak et al., 2014).

$p'_t = \frac{p_t-E(p))}{\sigma(p)}$

I think that'll probably suit you well, but play around with other ideas depending on the range of your data.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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