LSRC V3 updates :
Line backround fills
- You can now change the colors of the line fills between each regression line
T test for testing significance of a slope coeffiecnt estimate
- To test if there is a statistically significant relationship between our xj and y variable or if xj is a valid and useful linear predictor of y , in this case ia time (e.g. 1 day) a useful linear predictor of close price, A T test on the regression slope coefficient estimate of xj may be carried out.
The regression T test, tests if the slope coefficient of xj equals 0, if so no relationship exists between x and y, in this case this would mean time (over the given lookback) is not a useful linear predictor of close price, note however a trend between time and close price may just exist just not in the linear case, an exponential or logarithmic regression may fit the data and describe the relationship between time and close price very well i.e. validating a market trend over a certain lookback
The T test measures how many estimated standard deviations the slope coefficient is away from zero and given the degrees of freedom (n-k-1 = n-2 in the SLR case) and significance level a critical value may be found to test the test statistical against and decide if the effect of xj on y is statistically different from 0. In the two tail case (The case this model takes into consideration) were we test to see if the slope coefficient estimate is not > 0 or < 0 but not equal to 0 in the alternative case, the rejection rule were we reject Ho (slope coefficient equals 0) in favor of H1 (slope coefficient is different from or not equal to 0) would be given by the identity for rejection which is, if the absolute value of the t-test is greater than the critical value then reject H0 in favor of H1 at the alpha significance level. visually this would mean the t value lies within the rejection region were its value is greater / less than the critical values.
If the number of degrees of freedom is large, the t-distribution can be approximated by the standard normal distribution, in practice when the number of observations (number of j's such that their are xj observations) is > 122 the critical values for the t-test for 10% alpha is 1.64, for the 5% alpha is 1.96 and for the 1% alpha is 2.58, this means that when the t-test stat is > than these critical values it at a higher standard deviation away from 0 and it falls in all the rejection regions, if all their is a statistically significant relationship the table will state "β1 ≠ 0, reject H0 at the alpha significance level, β1 is statistically significant / different from 0.".
note this feature is best to apply on the 1D timeframe, as the chart time frame decreases the t-test value decreases and cannot be displayed.
General code clean up