Lecture 2 (.ppt part)

Download Report

Transcript Lecture 2 (.ppt part)

UNR * STAT 758 * Fall 2006
What is the period?
320 330 340 350 360
CO2 in parts per million (ppm)
Mauna Loa Atmospheric CO2 Concentration
1960
1970
1980
Time, years
R-code
par(bg='yellow')
plot(co2,lwd=2,col=4,xlab='Time, years',ylab='CO2 in
parts per million (ppm)',
main='Mauna Loa Atmospheric CO2 Concentration')
abline(v=seq(1950,2006,by=10),lty=2)
abline(h=seq(320,360,by=10),lty=2)
UNR * STAT 758 * Fall 2006
1990
320 330 340 350 360
CO2 in parts per million (ppm)
Mauna Loa Atmospheric CO2 Concentration
1960
1970
1980
Time, years
R-code
# This line adds yearly grid
abline(v=seq(1950,2006,by=1),lty=2)
UNR * STAT 758 * Fall 2006
1990
320 330 340 350 360
CO2 in parts per million (ppm)
Mauna Loa Atmospheric CO2 Concentration
1960
1970
1980
Time, years
R-code
# Filter with 1-year window and plot a trend
f<-filter(co2,rep(1,12)/12)
points(f,col=2,type='l',lwd=2)
UNR * STAT 758 * Fall 2006
1990
0
-2
-4
CO2-trend
2
4
Detrended CO2 series
1960
1970
1980
1990
Time, years
R-code
# Plot series minus trend
plot(co2-f,ldw=2,col=4,lwd=2,
xlab='Time, years',ylab='CO2-trend',main='Detrended CO2 series')
abline(h=seq(-4,4,by=2),lty=2)
abline(v=seq(1950,2006,by=1),lty=2)
UNR * STAT 758 * Fall 2006
2
1
0
-1
-2
-3
Seasonal component
3
Seasonal Component of CO2 data
1
2
3
4
5
6
7
8
Month
R-code
# Perform seasonal analysis and plot season component
m<decompose(co2)
plot(m$figure,lwd=2,type='p',pch=19,col=4,
xlab='Month',ylab='Seasonal component')
axis(1,at=seq(1,12))
grid(col='black',lty=2)
UNR * STAT 758 * Fall 2006
9
10
11
12
350
340
R-code
330
m<decompose(co2)
plot(m)
340
1
0
-1
0.0
-0.5
random
0.5
-3
-2
seasonal
2
320
330
trend
350
360
320
observed
360
Decomposition of additive time series
1960
1970
1980
1990
Time
UNR * STAT 758 * Fall 2006
UNR * STAT 758 * Fall 2006
0
-5
-10
Observations
5
10
Data from a Signal+Noise model
0
2
4
6
Time
UNR * STAT 758 * Fall 2006
8
10
12
Data from a Signal+Noise model
0
-1
Observations
0
-2
-5
-3
-10
Observations
1
5
2
10
3
Data from a Signal+Noise model
0
2
4
6
8
10
12
Estimated signal
0
Time
2
4
6
Time
UNR * STAT 758 * Fall 2006
8
10
12
UNR * STAT 758 * Fall 2006
360
350
340
330
320
CO2 in parts per million (ppm)
Mauna Loa Atmospheric CO2 Concentration
1960
1970
1980
Time, years
UNR * STAT 758 * Fall 2006
1990
2.0
1.5
1.0
0.5
0.0
diff(CO2,12)
2.5
3.0
12th-Order Difference of CO2 series
1960
1970
1980
Time, years
UNR * STAT 758 * Fall 2006
1990
0
-1
-2
diff(CO2,1)
1
2
First-Order Difference of CO2 series
1960
1970
1980
Time, years
UNR * STAT 758 * Fall 2006
1990
0.5
0.0
-0.5
-1.0
diff(diff(CO2,12),1)
1.0
(12+1)-Difference of CO2 series
1960
1970
1980
Time, years
UNR * STAT 758 * Fall 2006
1990