Autocorrelation

การวิเคราะห์อนุกรมเวลาใน R

David S. Matteson

Associate Professor at Cornell University

Autocorrelation - I

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

การวิเคราะห์อนุกรมเวลาใน R

Autocorrelation - 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

การวิเคราะห์อนุกรมเวลาใน R

Autocorrelation ที่ lag 1 และ 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
การวิเคราะห์อนุกรมเวลาใน R

Autocorrelation ที่ lag 1 และ 2 - II

การวิเคราะห์อนุกรมเวลาใน R

ฟังก์ชัน Autocorrelation - 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
การวิเคราะห์อนุกรมเวลาใน R

ฟังก์ชัน Autocorrelation - II

acf(stock_A, plot = TRUE)

การวิเคราะห์อนุกรมเวลาใน R

มาฝึกกันเถอะ!

การวิเคราะห์อนุกรมเวลาใน R

Preparing Video For Download...