seasonal analysis
DESCRIPTION
Seasonal Analysis. What is the period?. 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). R-code. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/1.jpg)
![Page 2: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/2.jpg)
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
![Page 3: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/3.jpg)
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
![Page 4: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/4.jpg)
# 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
![Page 5: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/5.jpg)
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
![Page 6: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/6.jpg)
# 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
![Page 7: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/7.jpg)
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
![Page 8: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/8.jpg)
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
![Page 9: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/9.jpg)
![Page 10: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/10.jpg)
0 2 4 6 8 10 12
-10
-50
510
Data from a Signal+Noise model
Time
Obs
erva
tions
![Page 11: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/11.jpg)
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
![Page 12: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/12.jpg)
![Page 13: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/13.jpg)
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
![Page 14: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/14.jpg)
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
![Page 15: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/15.jpg)
First-Order Difference of CO2 series
Time, years
diff
(CO
2,1)
1960 1970 1980 1990
-2-1
01
2
![Page 16: Seasonal Analysis](https://reader036.vdocuments.net/reader036/viewer/2022062301/568159a3550346895dc6fc48/html5/thumbnails/16.jpg)
(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