Correlogram Analysissssssssssssssss.pptx

ManikaA2 9 views 10 slides Sep 16, 2025
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

gcjfhkvbkhgb


Slide Content

Correlogram Analysis

A correlogram is simply a plot of the autocorrelation function for sequential values of lag k= 0,1,2,…,n. It allows us to see the correlation structure in each lag. The correlogram can be plotted in R using the acf () function.

Example 1: The correlogram for a sequence of normally distributed random variables can be plotted in R using the acf() function. The full R code is as follows: > set.seed(1) > w <- rnorm(100) > w > acf(w)

Output:

Example 2: The following R code generates a sequence of integers from 1 to 100 and then plots the autocorrelation: > w <- seq(1, 100) > w Output: [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 [37] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [55] 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 [73] 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 [91] 91 92 93 94 95 96 97 98 99 100 > acf(w)

Output:

Example 3: Let us consider the time series data of the age of death of 42 successive kings of England. > kingstimeseries<- scan ("http://robjhyndman.com/tsdldata/misc/kings.dat",skip=3) > Kingstimeseries Output: [1] 60 43 67 50 56 42 50 65 68 43 65 34 47 34 49 41 13 35 53 56 16 43 69 59 48 [26]59 86 55 68 51 33 49 67 77 81 67 71 81 68 70 77 56 > acf(kingstimeseries)

Output:

Try it out! Plot the correlogram for a repeated sequence of numbers with period p=10. > w <- rep(1:10, 10) > w > acf(w)

Thank You!
Tags