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

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Incluir Página
Currencies Projection using Linear Regression (MATA090 - SIGAFAT)
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:

Image Removed 

Example:

y = 80 + 4x

 

See the linear equation chart for the trend:

Image Removed 

 

First, "b" is calculated:

Image Removed 

 

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.

 

 Image Removed

 

Then, "a" is calculated:

 Image Removed

 

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.

 

 Image Removed

 

Then, the straight line equation is formed:

 Image Removed

 

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

Image RemovedTip:

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

...