Autokorelasi

Analisis Deret Waktu dengan R

David S. Matteson

Associate Professor at Cornell University

Autokorelasi - I

# Lag 1 Autocorrelation: 
# Correlation of stock A "today" and stock A "yesterday"
cor(stock_A[-100], stock_A[-1])
0.84

Analisis Deret Waktu dengan R

Autokorelasi - II

# Lag 2 Autocorrelation:
# Correlation of Stock A "today" and stock A "Two Days Earlier"
cor(stock_A[-(99:100)],stock_A[-(1:2)])
0.76

Analisis Deret Waktu dengan R

Autokorelasi pada lag 1 dan 2 - I

cor(stock_A[-100],stock_A[-1])
0.84
cor(stock_A[-(99:100)],stock_A[-(1:2)])
0.76
acf(stock_A, lag.max = 2, plot = FALSE)
Autocorrelations of series 'stock_A', by lag
  1    2
0.84  0.76
Analisis Deret Waktu dengan R

Autokorelasi pada lag 1 dan 2 - II

Analisis Deret Waktu dengan R

Fungsi autokorelasi - I

# Autocorrelation by lag: "The Autocorrelation Function" 
(ACF)acf(stock_A, plot = FALSE)
Autocorrelations of series 'stock_A', by lag
  1    2    3    4    5    6    7    8    9   10
0.84 0.76 0.64 0.57 0.52 0.46 0.41 0.36 0.29 0.25
Analisis Deret Waktu dengan R

Fungsi autokorelasi - II

acf(stock_A, plot = TRUE)

Analisis Deret Waktu dengan R

Ayo berlatih!

Analisis Deret Waktu dengan R

Preparing Video For Download...