# Should I rescale inputs for a neural networks? (Application on predicting stock market)

I'm implementing an ANN that predicts the stock market but I have a doubt about which inputs should I take into account and the best way to normalize them. I want to predict the daily highest value and for this reason I want to consider 'open value', 'lowest value', ' close value', 'volume value, and 'Adj close value'. The problem is that the 'volume' has a value way bigger that the others (i.e. datum1: 2071.820068,2073.850098,2052.280029,2065.300049,4704720000,2065.300049).

How should I normalize these inputs?

• You may have more answers there: quant.stackexchange.com Good luck at predicting the unpredictable :)
– mic
Dec 20, 2016 at 19:59
• I assume that you realize that what you're trying to do is impossible. This must be a class project? Dec 20, 2016 at 20:00
• aha I know that's impossible, its just a class project. I've already implemented the network but Im having some issues with inputs and normalization
– Pino
Dec 20, 2016 at 20:03

Anyway, there are many ways to standardize, usually by first centering and then scaling. I'll list three common methods. Let $x \in \mathbb{R}^n$ be a vector of measurements (a feature) and let $\tilde{x}$ be its standardized version.
1. $\ell_2$ standardization works well when your data is normal or platykurtic and not too skewed: $$\tilde{x} = \frac{x - \mathbf{mean}(x)}{\|x - \mathbf{mean}(x)\|_2}$$ In this case $\mathbf{mean}(\tilde{x}) = 0$ while $\|\tilde{x}\|_2 = 1$.
2. $\ell_1$ standardization is a robust alternative to $\ell_2$ and works better when your data is highly leptokurtic, is corrupted by outliers, or is very skewed: $$\tilde{x} = \frac{x - \mathbf{median}(x)}{\|x - \mathbf{median}(x)\|_1}$$ In this case $\mathbf{median}(\tilde{x}) = 0$ while $\|\tilde{x}\|_1 = 1$. This is the one I tend to use when working with financial data like returns and volume.
3. $\ell_\infty$ standardization is typically used with uniform distribution or others where the data is known to have a bounded support: $$\tilde{x} = \frac{x - \mathbf{min}(x)}{\|x - \mathbf{min}(x)\|_\infty}$$ In this case $\mathbf{min}(\tilde{x}) = 0$ and $\mathbf{max}(\tilde{x}) = 1$.
The comments I added when explaining when each methods works best are purely anecdotal and it's quite common for practitioners to try different methods and judge using objective metrics like out-of-sample forecasting error. I know, for example, that $\ell_\infty$ standardization is a favorite in the deep learning literature, even when the sampling distribution is approximately normal.