# Technical Studies Reference

- Technical Studies Reference
- Common Study Inputs (Opens a new page)
- Using Studies (Opens a new page)

### Inertia 2

This study calculates and displays the Inertia 2 study. The step-by-step calculation method is explained below.

The components of the Relative Vigor Index (RVI) are calculated as follows. We let \(C_i\) be the closing price at time index \(i\). We also let \(r\) be the RVI Length and let \(s\) be the Standard Deviation Length, both of which are inputs.

*Standard Deviation*:

The \(i^{th}\) moving average of the closing prices taken \(s\) at a time is given as follows.

$$\overline{C}_i=\frac{1}{s}\sum_{k=1}^s{C_{k+i-1}}$$This is the average of the sequence of \(C\)'s starting at \(C_i\) and ending at \(C_{s+i-1}\). This will enter into our formula for standard deviation, which is given as follows.

$$StdDeviation_i=\sqrt{\frac{1}{n}\sum_{k=1}^s{\left(C_{k+i-1}-\overline{C}_i\right)^2}}$$This is the standard deviation of the sequence of \(C\)'s starting at \(C_i\) and ending at \(C_{s+i-1}\).

*RVI Up*:

According to this formula, \(RVIUp_i\) is nonzero if and only if the closing price is *increasing*.

*RVI Down*:

According to this formula, \(RVIDown_i\) is nonzero if and only if the closing price is *nonincreasing*.

*RVI Up Average*:

This moving average is a recursion relation with \(RVIUpAvg_0=0\).

*RVIDownAvg*:

This moving average is a recursion relation with \(RVIDownAvg_0=0\).

** RVI:** From these we calculate the RVI as follows.

*Inertia Calculation*:

The inertia of the RVI is precisely the Linear Regression Indicator (LRI) of the RVI. The LRI is described in detail in Moving Linear Regression / Moving Average - Least Squares. We let \(l\) be the Linear Regression Length, which is an input. The regression statistics are calculated for each \(i\) where the data points are taken \(l\) at a time. Explicit formulas are given below.

$$b_i=\frac{l \cdot \sum_{k=1}^l{(k+i-1)RVI_{k+i-1}}-\sum_{k=1}^l{(k+i-1)}\cdot \sum_{k=1}^l{RVI_{k+i-1}}}{l \cdot \sum_{k=1}^l{(k+i-1)^2}-\left(\sum_{k=1}^l{(k+i-1)}\right)^2}$$ $$a_i=\frac{\sum_{k=1}^l{RVI_{k+i-1}}-b_i \cdot \sum_{k=1}^l{(k+i-1)}}{l}$$ $$LRI_i=a_i+lb_i$$*Last modified Friday, 09th June, 2017.