Post on 03-Feb-2016
description
transcript
Mauna Loa Atmospheric CO2 Concentration
Time, years
CO
2 in
par
ts p
er m
illio
n (p
pm)
1960 1970 1980 1990
320
330
340
350
360
What is the period?
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)
R-code
Mauna Loa Atmospheric CO2 Concentration
Time, years
CO
2 in
par
ts p
er m
illio
n (p
pm)
1960 1970 1980 1990
320
330
340
350
360
# This line adds yearly gridabline(v=seq(1950,2006,by=1),lty=2)
R-code
# Linear trendtime<-time(co2)l<-lsfit(time,co2)points(time,time*l$coefficients[2]+l$coefficients[1],type='l',col='green')
R-code
Mauna Loa Atmospheric CO2 Concentration
Time, years
CO
2 in
pa
rts
pe
r m
illio
n (
pp
m)
1960 1970 1980 1990
32
03
40
36
0
Mauna Loa Atmospheric CO2 Concentration
Time, years
CO
2 in
par
ts p
er m
illio
n (p
pm)
1960 1970 1980 1990
320
330
340
350
360
# Filter with 1-year window and plot a trendf<-filter(co2,rep(1,12)/12)points(f,col=2,type='l',lwd=2)
R-code
# Plot series minus trendplot(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)
R-code
Detrended CO2 series
Time, years
CO
2-tr
end
1960 1970 1980 1990
-4-2
02
4
UNR * STAT 758 * Fall 2006
# Perform seasonal analysis and plot season componentm<-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)
R-code
2 4 6 8 10 12
-3-2
-10
12
3
Seasonal Component of CO2 data
Month
Sea
sona
l com
pone
nt
1 2 3 4 5 6 7 8 9 10 11 12
320
330
340
350
360
obse
rved
320
330
340
350
360
tren
d
-3-2
-10
12
seas
onal
-0.5
0.0
0.5
1960 1970 1980 1990
rand
om
Time
Decomposition of additive time series
m<-decompose(co2)plot(m)
R-code
0 2 4 6 8 10 12
-10
-50
510
Data from a Signal+Noise model
Time
Obs
erva
tions
0 2 4 6 8 10 12
-10
-50
510
Data from a Signal+Noise model
Time
Obs
erva
tions
0 2 4 6 8 10 12-3
-2-1
01
23
Data from a Signal+Noise model
Time
Obs
erva
tions
Estimated signal
Mauna Loa Atmospheric CO2 Concentration
Time, years
CO
2 in
par
ts p
er m
illio
n (p
pm)
1960 1970 1980 1990
320
330
340
350
360
12th-Order Difference of CO2 series
Time, years
diff
(CO
2,12
)
1960 1970 1980 1990
0.0
0.5
1.0
1.5
2.0
2.5
3.0
First-Order Difference of CO2 series
Time, years
diff
(CO
2,1)
1960 1970 1980 1990
-2-1
01
2
(12+1)-Difference of CO2 series
Time, years
diff
(diff
(CO
2,12
),1)
1960 1970 1980 1990
-1.0
-0.5
0.0
0.5
1.0