Currencies Projection using Linear Regression

Below is an example of how to calculate projection of currencies using linear regression. This method is used by Protheus.

 

Period, variable x (independent)

Value, variable y (dependent)

x2

x * y

1

1.55

1

1.55

2

1.58

4

3.16

Sum

3

3.13

5

4.71

 

To project the currency value, use the straight line equation:

16f2e1b4-2b4d-428c-85c8-d8b76f74e834

Example:

y = 80 + 4x

 

See the linear equation chart for the trend:

08b23030-53a8-4316-a121-3f7c3fbc280f

 

First, \"b\" is calculated:

e144a8be-767d-40af-8653-f12a4410292d

 

Where:

n = number of periods. In this example, it is 2, which is equal to the number of days to go back, before the system date.

 

7bbed928-6915-4959-810f-bf68f8cd2372

 

Then, \"a\" is calculated:

99a843ab-4a2e-47bb-bf70-50fc186077d0

 

Where:

n = number of periods. In this example, it is 2, which is equal to the number of days to go back, before the system date.

 

69a01349-922d-4fdd-8bcd-d0d7655cba07

 

Then, the straight line equation is formed:

bb984880-09ae-44b4-aa46-90922732aa38

 

To find the value of period 3:

y = 1.52 + 0.03*3 = 1.61

 

To find the value of period 4:

y = 1.52 + 0.03*4 = 1.64

 

To find the value of period 5:

y = 1.52 + 0.03*5 = 1.67

 

To find the value of period 6:

y = 1.52 + 0.03*6 = 1.70

 

d4ab49a2-8aac-4780-b7f4-09f146fb48beTip:

Period refers to a day, a month, a year etc.

In the above example, only two periods were used as regression but more periods can be used.