Regression analysis can be ranked among the statistical methods for studying the relationship between certain variables (dependent and independent). In this case, independent variables are called “regressors”, and dependent variables are called “criteria”. When conducting linear regression analysis, the representation of the dependent variable is carried out in the form of an interval scale. There is a possibility of non-linear relationships between variables related to the interval scale, but this problem is already being solved by non-linear regression methods, which is not the topic of this article.
Linear regression has been used quite successfully both in mathematical calculations and in economic studies based on statistical data.
So, we will consider such regression in more detail. From the point of view of the mathematical method for determining the linear relationship between some variables, linear regression can be represented as such a formula: y = a + bx. An explanation of this formula can be found in any econometrics textbook.
When expanding the number of observations (up to the nth number of times), a simple linear regression is obtained, presented in the form of the formula:
yi = A + bxi + ei,
where ei are independent random variables distributed identically.
In this article, I would like to pay more attention to this concept from the point of view of forecasting future prices based on previous data. In this area of ​​calculus, linear regression actively uses the least squares method, which helps to build the “most suitable” straight line through a certain series of price value points. As input data, price points are used, which mean the maximum, minimum, closing or opening, as well as average indicators from these values ​​(for example, the sum of the maximum and minimum divided by two). Also, this data can be arbitrarily smoothed before building a suitable line.
As mentioned above, linear regression is often used in analytics to determine a trend based on price and time data. In this case, the regression slope indicator allows you to determine the magnitude of price changes per unit time. One of the conditions for making the right decision when using this indicator is the use in the form of a signal generator, following the trend of the regression slope. With a positive slope (increasing linear regression), a purchase is made if the indicator value is greater than zero. During a negative slope (decreasing regression), sales should be carried out with negative indicator values ​​(less than zero).
Used in determining the best line corresponding to a certain series of price points, the least squares method involves the following algorithm:
- the total expression of the squares of the difference in price and the regression line is found;
- the ratio of the received amount and the number of bars is in the range of the regression data series;
- the square root is calculated from the result , which corresponds to the standard deviation.
The paired linear regression equation has the following model:
y (x) = f ^ (x),
where y is an effective attribute represented by a dependent variable;
x is an explanatory or independent variable;
^ shows the absence of a strict functional relationship between the variables x and y. Therefore, in each particular case, the variable y can be composed of the following terms:
y = yx + ε,
where y is the actual data of the result;
uh - theoretical data of the result, determined by solving the regression equation ;
ε is a random variable that characterizes the deviation between the actual value and the theoretical.