Sharp manual Moving Average, Calculation, EL-9900 Graphing Calculator, Hi =, I = 1 +, 2 + M-1

Models: EL-9900

1 38
Download 38 pages 46.35 Kb
Page 23
Image 23
Moving Average

EL-9900 Graphing Calculator

Moving Average

Plot a moving average graph which helps to understand how the results change over a specified period. The progress of sales and amounts of consumption and production can also be seen.

 Calculation Calculation

Hi =

Xi-(M-1) / 2

+ ... + Xi + ... Xi+(M-1) / 2

 

 

M

 

 

 

 

 

 

 

 

 

( I = 1 +

M-1

, 2 + M-1

, ... , n +

M-1 )

 

 

2

2

 

2

Hi : moving average

M: number of divisions Xi : data

n : number of data

FLOWCHART

 

PROGRAMME LIST

 

Title : MVIN AVG

Start

MAIN

Label MAIN

Print "Input DIVISION

Entry of number of divisions

Y

M>=n

Hi = N

Setting of calculation range

Calculation

Gosub count

Enter unit for calculating average.

Returns to entry of no. of divisions if the number of divisions more than no. of data.

Range for graph set.

I = 0, K = int (M/2)

First calculation. Jumps to subroutine.

Input D

D M

1_Stats L1

If Mn Goto MAIN

Rem RANGE

(xmax-xmin)/10 Yscl

0

Xmin

n

Xmax

1

Xscl

xmin

Ymin

xmax

Ymax

0

I

 

 

 

LOOP1

 

 

 

 

 

Gosub MOVINGSUM

 

Jumps to subroutine.

Y

Number of calculation times of moving sum judged.

 

 

M>=J

Repeated until calculation of no. of divisions performed.

 

 

 

 

 

 

 

 

N

 

int (M/2) K

Gosub COUNT

Label LOOP1

Gosub MOVINGSUM

If MJ Goto LOOP1

Gosub AVERAGE

Gosub AVERAGE

LOOP2

X = K, Y = H

Substitution

 

 

 

 

 

Jumps to

 

 

Gosub COUNT

 

 

subroutine.

LOOP3

Jumps to

Gosub MOVINGSUM

 

 

subroutine.

 

 

COUNT

I = I + 1, J = I, S = 0

Return

MOVINGSUM

Subroutine Setting of counter

Subroutine Calculation of

Label LOOP2

K

X

H

Y

Gosub COUNT

Label LOOP3

Gosub MOVINGSUM

If (I+M)>J Goto LOOP3

Gosub AVERAGE

Line (X, Y, K, H)

If K(n-int (M/2))Goto LOOP2

Y

(I+M)>J

+ ... + Xi + ... Xi+(M-1) / 2 N

Gosub AVERAGE

Display of line

YK(n-int(M/2))

( I = 1 + N

End

Jumps to subroutine.

Line displayed.

Judgment of end.

Calculation of moving sum

Return

AVERAGE

Calculation of moving average

Return

moving sum

Subroutine Calculation of average

Wait

 

End

 

Label COUNT

I+1

I

I

J

 

0

S

Return

Label MOVINGSUM

S+L1(J) S

J+1

J

Return

Label AVERAGE

S/M

H

K+1

K

Return

16

Page 23
Image 23
Sharp manual Moving Average, Calculation, EL-9900 Graphing Calculator, Hi =, I = 1 +, 2 + M-1, + ... + Xi + ... Xi+M-1