Páginas filhas
  • Currencies Projection using Linear Regression (MATA090 - SIGAFAT)


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:

 

Example:

y = 80 + 4x


See the linear equation chart for the trend:

 


First, "b" is calculated:

 


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.


 


Then, "a" is calculated:

 


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.


 


Then, the straight line equation is formed:

 


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


Tip:

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.