Set working directory to where the data is stored.
setwd("~/College/Msc Climate Change/GY663/Lisa Orme/ENC__Final_GY663_Workhshop")
Load the appropriate packages for the analysis.
library(bspec)
##
## Attaching package: 'bspec'
## The following object is masked from 'package:stats':
##
## acf
## The following object is masked from 'package:base':
##
## sample
library(lomb)
library(WaveletComp)
library(zoo)
## Warning: package 'zoo' was built under R version 3.5.3
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
library(quantmod)
## Warning: package 'quantmod' was built under R version 3.5.3
## Loading required package: xts
## Warning: package 'xts' was built under R version 3.5.3
## Loading required package: TTR
## Warning: package 'TTR' was built under R version 3.5.3
## Version 0.4-0 included new data defaults. See ?getSymbols.
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.5.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:xts':
##
## first, last
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(astrochron)
## Warning: package 'astrochron' was built under R version 3.5.3
## Welcome to astrochron v0.9 (2019-01-08)
##
## Attaching package: 'astrochron'
## The following object is masked from 'package:quantmod':
##
## peak
library(IRISSeismic)
## Warning: package 'IRISSeismic' was built under R version 3.5.3
##
## Attaching package: 'IRISSeismic'
## The following object is masked from 'package:astrochron':
##
## hilbert
## The following object is masked from 'package:dplyr':
##
## slice
library(Hmisc)
## Warning: package 'Hmisc' was built under R version 3.5.3
## Loading required package: lattice
## Loading required package: survival
##
## Attaching package: 'survival'
## The following object is masked from 'package:WaveletComp':
##
## ridge
## Loading required package: Formula
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.5.3
##
## Attaching package: 'ggplot2'
## The following object is masked from 'package:WaveletComp':
##
## arrow
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following object is masked from 'package:quantmod':
##
## Lag
## The following objects are masked from 'package:base':
##
## format.pval, units
For the purpose of this analysis, going to look at Central England Temperature record. Need to load the csv file into R using the following code.
CET = read.csv(file = "CET.csv", header = TRUE, sep = ",")
Use head and tail function to visually inspect the data. From the output it is clear that there 14 columns that contain data regarding the years and months for CET. The data ranges from 2018 to 1668.
head(CET, n = 10)
## Year JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC YEAR
## 1 2018 5.3 2.9 4.9 9.8 13.2 16.1 19.1 16.6 13.7 10.6 8.3 6.9 10.68
## 2 2017 4.0 6.1 8.7 8.9 13.2 16.0 16.8 15.6 13.5 12.4 6.8 4.8 10.58
## 3 2016 5.4 4.9 5.8 7.5 12.5 15.2 16.9 17.0 16.0 10.9 5.6 6.0 10.34
## 4 2015 4.4 4.0 6.4 9.0 10.8 14.0 15.9 15.9 12.6 11.0 9.5 9.7 10.31
## 5 2014 5.7 6.2 7.6 10.2 12.2 15.1 17.7 14.9 15.1 12.5 8.6 5.2 10.95
## 6 2013 3.5 3.2 2.7 7.5 10.4 13.6 18.3 16.9 13.7 12.5 6.2 6.3 9.61
## 7 2012 5.4 3.8 8.3 7.2 11.7 13.5 15.5 16.6 13.0 9.7 6.8 4.8 9.72
## 8 2011 3.7 6.4 6.7 11.8 12.2 13.8 15.2 15.4 15.1 12.6 9.6 6.0 10.72
## 9 2010 1.4 2.8 6.1 8.8 10.7 15.2 17.1 15.3 13.8 10.3 5.2 -0.7 8.86
## 10 2009 3.0 4.1 7.0 10.0 12.1 14.8 16.1 16.6 14.2 11.6 8.7 3.1 10.14
tail(CET, n = 10)
## Year JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC YEAR
## 351 1668 5 5 5 8 10 14 16 16 14 10 6 5 9.51
## 352 1667 0 4 2 7 10 15 17 16 13 9 6 3 8.52
## 353 1666 4 5 6 8 11 15 18 17 14 11 6 3 9.86
## 354 1665 1 1 5 7 10 14 16 15 13 9 6 2 8.29
## 355 1664 4 5 5 8 11 15 16 16 13 9 6 4 9.34
## 356 1663 1 1 5 7 10 14 15 15 13 10 7 5 8.63
## 357 1662 5 6 6 8 11 15 15 15 13 11 6 3 9.52
## 358 1661 5 5 6 8 11 14 15 15 13 11 8 6 9.78
## 359 1660 0 4 6 9 11 14 15 16 13 10 6 5 9.10
## 360 1659 3 4 6 7 11 13 16 16 13 10 5 2 8.87
Can use the plot function to view the temperature variation for each of the months from 1668 to 2018. However from the output it is difficult to see if there is trends or cycles from the plot.
plot(CET$Year, CET$JAN, type = 'l', col = 'blue', main = 'CET temperature variation 1668 to 2018', xlab = 'Years', ylab = 'Temperature', ylim = c(-4,20), xlim = c(1590,2020))
lines(CET$Year, CET$FEB, col = 'cyan')
lines(CET$Year, CET$MAR, col = 'Green3')
lines(CET$Year, CET$APR, col = 'Orange')
lines(CET$Year, CET$MAY, col = 'Purple')
lines(CET$Year, CET$JUN, col = 'Yellow')
lines(CET$Year, CET$JUL, col = 'Pink')
lines(CET$Year, CET$AUG, col = 'Dark blue')
lines(CET$Year, CET$SEP, col = 'Dark green')
lines(CET$Year, CET$OCT, col = 'Red')
lines(CET$Year, CET$NOV, col = 'violet')
lines(CET$Year, CET$Dec, col = 'olivedrab')
legend("topleft",
legend=c("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"),
col= c("Blue", "Cyan", "Green3", "Orange", "Purple", "Yellow", "Pink", "Dark Blue",
"Dark Green", "Red", "Violet", "Olivedrab"), cex = 0.8, lty=1,lwd=1, bty="n")
Therefore, plot the annually averaged CET records to visualise any trends.There appears to be an increasing trend in temperature from about 1970 onwards.
plot(CET$Year, CET$YEAR, type = 'l', main = 'Annual average CET from 1668 to 2018', xlab = 'Years', ylab = 'Annually averaged Temperature', col = 'Olivedrab')
Want to do seasonal analysis so therefore make new dataframes that contain Winter (DJF), Spring (MAM), Summer (JJA) and Autumn (SON)
CET.winter <- CET[c(1:360), c(1,2,3,13)]
CET.spring <- CET[c(1:360), c(1,4,5,6)]
CET.summer <- CET[c(1:360), c(1,7,8,9)]
CET.autumn <- CET[c(1:360), c(1,10,11,12)]
Get the rowMeans of each of the months. This calculates the mean of each row, using square brackets allows for selection of columns, in which row means is to be conducted. The mean of the three rows is then stored in a new column named average.
CET.winter$average <- rowMeans(CET.winter[,c(2,3,4)])
CET.spring$average <- rowMeans(CET.spring[,c(2,3,4)])
CET.summer$average <- rowMeans(CET.summer[,c(2,3,4)])
CET.autumn$average <- rowMeans(CET.autumn[,c(2,3,4)])
For the purpose of this analysis, we just want the annual averages for each of the seasons. Therefore remove the month columns from each of the dataframes. This can be done by using the square brackets.
CET.winter <- CET.winter[c(1:360), c(1,5)]
CET.spring <- CET.spring[c(1:360), c(1,5)]
CET.summer <- CET.summer[c(1:360), c(1,5)]
CET.autumn <- CET.autumn[c(1:360), c(1,5)]
Can use the plot function to have a look at the seasonal trends in temperature.
plot(CET.winter$Year, CET.winter$average, type = 'l', xlab = 'years', ylab = 'temperature', main = 'Plot of seasonal temperature', col = 'green3', ylim = c(-2,18))
lines(CET.summer$Year, CET.summer$average, col = 'orange')
lines(CET.autumn$Year, CET.autumn$average, col = 'violet')
lines(CET.spring$Year, CET.spring$average, col = 'cyan')
legend("bottomright",
legend=c("Winter", "Spring", "Summer", "Autumn"),
col= c("Green3", "Cyan", "Orange","Violet"), cex = 0.8, lty=1,lwd=1, bty="n")
From the graph it is clear that summer has the highest temperatures, followed by Autumn. Winter has the lowest temperatures and is followed by Spring.
Detrend each of the seasonal data. This removes the linear trend from stratigraphic series.
CET.winter.detrend <- detrend(CET.winter)
##
## ----- SUBTRACTING LINEAR TREND FROM STRATIGRAPHIC SERIES -----
## * Slope= 0.003953477
## * y-intercept= -3.516986
CET.spring.detrend <- detrend(CET.spring)
##
## ----- SUBTRACTING LINEAR TREND FROM STRATIGRAPHIC SERIES -----
## * Slope= 0.002825459
## * y-intercept= 2.978171
CET.summer.detrend <- detrend(CET.summer)
##
## ----- SUBTRACTING LINEAR TREND FROM STRATIGRAPHIC SERIES -----
## * Slope= 0.001107789
## * y-intercept= 13.28379
CET.autumn.detrend <- detrend(CET.autumn)
##
## ----- SUBTRACTING LINEAR TREND FROM STRATIGRAPHIC SERIES -----
## * Slope= 0.003253849
## * y-intercept= 3.736503
Need to reorder the CET record data so that it starts in 1659 and ends in 2018. This will enable the creation of a timeseries dataframe.
CET.winter <- as.data.frame(CET.winter)
CET.winter <- CET.winter[order(CET.winter$Year),]
CET.spring <- as.data.frame(CET.spring)
CET.spring <- CET.spring[order(CET.spring$Year),]
CET.summer <- as.data.frame(CET.summer)
CET.summer <- CET.summer[order(CET.summer$Year),]
CET.autumn <- as.data.frame(CET.autumn)
CET.autumn <- CET.autumn[order(CET.autumn$Year),]
Convert the average temperature for each month in timeseries data
CET.winter.temp <- ts(CET.winter$average, start = 1659, end = 2018)
CET.spring.temp <- ts(CET.spring$average, start = 1659, end = 2018)
CET.summer.temp <- ts(CET.summer$average, start = 1659, end = 2018)
CET.autumn.temp <- ts(CET.autumn$average, start = 1659, end = 2018)
Calculate the welch method for each of the seasonal average temperatures and plot. Segment length is set to 70 so that cycles and frequencies may be identified.
CET.winter.spec1 <- welchPSD(CET.winter.temp, seglength=70)
plot(CET.winter.spec1$frequency, CET.winter.spec1$power, log='y',type="l")
CET.spring.spec1 <- welchPSD(CET.spring.temp, seglength=70)
plot(CET.spring.spec1$frequency, CET.spring.spec1$power, log='y',type="l")
CET.summer.spec1 <- welchPSD(CET.summer.temp, seglength=70)
plot(CET.summer.spec1$frequency, CET.summer.spec1$power, log='y',type="l")
CET.autumn.spec1 <- welchPSD(CET.autumn.temp, seglength=70)
plot(CET.autumn.spec1$frequency, CET.autumn.spec1$power, log='y',type="l")
To find the frequency and the cycles for Winter data, the following code was used. With a threshold of 5, the only frequency peak is equal to 0.1. The cycle identified based on a threshold of 5 has one peak of 10 years.
CET.winter.spec1$frequency[findPeaks(CET.winter.spec1$power, thresh=5)]
## [1] 0.1
1/0.1
## [1] 10
To find the frequency and cycles for the spring data the threshold was set to 5. This gave one frequency peak of 0.0714. The cycle identified has one peak of 14.0056 years.
CET.spring.spec1$frequency[findPeaks(CET.spring.spec1$power, thresh=5)]
## [1] 0.07142857
1/0.0714
## [1] 14.0056
To find the cycles and frequency for summer data the threshold was set to 5. This resulted in one frequency peak of 0.0571. The cycle identified had one peak of 17.5131 years.
CET.summer.spec1$frequency[findPeaks(CET.summer.spec1$power, thresh=5)]
## [1] 0.05714286
1/0.0571
## [1] 17.51313
To find the frequency and cycles associated with the autumn data, the threshold was set to 5. This resulted in one frequency peak of 0.1286. The cycle identified had one peak of 7.7760 years.
CET.autumn.spec1$frequency[findPeaks(CET.autumn.spec1$power, thresh=5)]
## [1] 0.1285714
1/0.1286
## [1] 7.77605
Export the detrended seasonal temperatures.
write.table(CET.winter.detrend, file = "CET.winter.detrend.csv", row.names = FALSE, col.names = TRUE, sep = ",")
write.table(CET.spring.detrend, file = "CET.spring.detrend.csv", row.names = FALSE, col.names = TRUE, sep = ",")
write.table(CET.summer.detrend, file = "CET.summer.detrend.csv", row.names = FALSE, col.names = TRUE, sep = ",")
write.table(CET.autumn.detrend, file = "CET.autumn.detrend.csv", row.names = FALSE, col.names = TRUE, sep = ",")
Import the NAO data using the read.csv and read.table function.
NAO.1 = read.csv(file = "NAO.csv", header = FALSE, sep = ",")
NAO <- read.table("NAO.csv", header=FALSE, sep=",")[,2]
Use and head and tail function to have a quick look at the data. The data starts in 1826 and ends in 2017.
head(NAO.1)
## V1 V2
## 1 1825 0.16
## 2 1826 0.27
## 3 1827 -0.45
## 4 1828 -0.88
## 5 1829 -0.09
## 6 1830 0.88
tail(NAO.1)
## V1 V2
## 188 2012 -0.63
## 189 2013 0.59
## 190 2014 0.10
## 191 2015 1.16
## 192 2016 0.39
## 193 2017 0.57
Plot NAO to visualise the variability. From the graph it is clear that NAO is highly variable, however there is a sharp decline in NAO around 2010.
plot(NAO.1$V1, NAO.1$V2, type = 'l', xlab = 'Years', ylab = 'NAO', main = 'NAO 1826 to 2017', col = 'darkblue')
Need to convert NAO into a timeseries for the purpose of this analysis.
NAO.ts <- ts(NAO, start=1826, end=2017)
Carry out the Welch spectral analysis on the NAO data.
NAO.Spec1 <- welchPSD(NAO.ts, seglength=100)
plot(NAO.Spec1$frequency, NAO.Spec1$power, type = 'l', ylab = 'power', xlab = 'frequency', main = 'Welch Spectral Analysis NAO', col = 'violet' )
To find the frequency and cycles associated with the NAO data, the following code was used and the threshold was set to 1. This resulted in three frequency peaks of 0.09, 0.14 and 0.21.
NAO.Spec1$frequency[findPeaks(NAO.Spec1$power, thresh=1)]
## [1] 0.09 0.14 0.21
To find the cycles use the following code. The cycle identified had three peaks of 11.1111 years, 7.14285 years and 4.761905 years.
1/0.09
## [1] 11.11111
1/0.14
## [1] 7.142857
1/0.21
## [1] 4.761905
This method is used to assess how two datasets covary through time.
First calender age needs to be defined. The length is 192 as that matches the length of the NAO temperature data (1825 to 2016)
date <- seq(as.POSIXct("1825-01-30 00:00:00", format = "%Y"),by = "year",length.out = 192)
Need to combine the new date column with the NAO and temperature data on a seasonal basis.This can be done using the cbind function.
winter.ts <- cbind(winter.ts,date)
spring.ts <- cbind(spring.ts,date)
summer.ts <- cbind(summer.ts,date)
autumn.ts <- cbind(autumn.ts,date)
Conduct a wavelet coherency analysis for each of the seasons.
winter.wc <- analyze.coherency(winter.ts, c(1, 2), dt=1)
## Smoothing the time series...
## Starting wavelet transformation and coherency computation...
## ... and simulations...
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 11%
|
|======== | 12%
|
|======== | 13%
|
|========= | 14%
|
|========== | 15%
|
|========== | 16%
|
|=========== | 17%
|
|============ | 18%
|
|============ | 19%
|
|============= | 20%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 23%
|
|================ | 24%
|
|================ | 25%
|
|================= | 26%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|===================== | 33%
|
|====================== | 34%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 37%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 40%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 43%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 46%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 51%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 54%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 57%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 60%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 63%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 66%
|
|============================================ | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 77%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 80%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 83%
|
|======================================================= | 84%
|
|======================================================= | 85%
|
|======================================================== | 86%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 89%
|
|========================================================== | 90%
|
|=========================================================== | 91%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 94%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 97%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 100%
## Class attributes are accessible through following names:
## series loess.span dt dj Wave.xy Angle sWave.xy sAngle Power.xy Power.xy.avg Power.xy.pval Power.xy.avg.pval Coherency Coherence Coherence.avg Coherence.pval Coherence.avg.pval Wave.x Wave.y Phase.x Phase.y Ampl.x Ampl.y Power.x Power.y Power.x.avg Power.y.avg Power.x.pval Power.y.pval Power.x.avg.pval Power.y.avg.pval sPower.x sPower.y Ridge.xy Ridge.co Ridge.x Ridge.y Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz
spring.wc <- analyze.coherency(spring.ts, c(1, 2), dt=1)
## Smoothing the time series...
## Starting wavelet transformation and coherency computation...
## ... and simulations...
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 11%
|
|======== | 12%
|
|======== | 13%
|
|========= | 14%
|
|========== | 15%
|
|========== | 16%
|
|=========== | 17%
|
|============ | 18%
|
|============ | 19%
|
|============= | 20%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 23%
|
|================ | 24%
|
|================ | 25%
|
|================= | 26%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|===================== | 33%
|
|====================== | 34%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 37%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 40%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 43%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 46%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 51%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 54%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 57%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 60%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 63%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 66%
|
|============================================ | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 77%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 80%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 83%
|
|======================================================= | 84%
|
|======================================================= | 85%
|
|======================================================== | 86%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 89%
|
|========================================================== | 90%
|
|=========================================================== | 91%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 94%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 97%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 100%
## Class attributes are accessible through following names:
## series loess.span dt dj Wave.xy Angle sWave.xy sAngle Power.xy Power.xy.avg Power.xy.pval Power.xy.avg.pval Coherency Coherence Coherence.avg Coherence.pval Coherence.avg.pval Wave.x Wave.y Phase.x Phase.y Ampl.x Ampl.y Power.x Power.y Power.x.avg Power.y.avg Power.x.pval Power.y.pval Power.x.avg.pval Power.y.avg.pval sPower.x sPower.y Ridge.xy Ridge.co Ridge.x Ridge.y Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz
summer.wc <- analyze.coherency(summer.ts, c(1, 2), dt=1)
## Smoothing the time series...
## Starting wavelet transformation and coherency computation...
## ... and simulations...
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 11%
|
|======== | 12%
|
|======== | 13%
|
|========= | 14%
|
|========== | 15%
|
|========== | 16%
|
|=========== | 17%
|
|============ | 18%
|
|============ | 19%
|
|============= | 20%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 23%
|
|================ | 24%
|
|================ | 25%
|
|================= | 26%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|===================== | 33%
|
|====================== | 34%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 37%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 40%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 43%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 46%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 51%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 54%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 57%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 60%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 63%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 66%
|
|============================================ | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 77%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 80%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 83%
|
|======================================================= | 84%
|
|======================================================= | 85%
|
|======================================================== | 86%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 89%
|
|========================================================== | 90%
|
|=========================================================== | 91%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 94%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 97%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 100%
## Class attributes are accessible through following names:
## series loess.span dt dj Wave.xy Angle sWave.xy sAngle Power.xy Power.xy.avg Power.xy.pval Power.xy.avg.pval Coherency Coherence Coherence.avg Coherence.pval Coherence.avg.pval Wave.x Wave.y Phase.x Phase.y Ampl.x Ampl.y Power.x Power.y Power.x.avg Power.y.avg Power.x.pval Power.y.pval Power.x.avg.pval Power.y.avg.pval sPower.x sPower.y Ridge.xy Ridge.co Ridge.x Ridge.y Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz
autumn.wc <- analyze.coherency(autumn.ts, c(1, 2), dt=1)
## Smoothing the time series...
## Starting wavelet transformation and coherency computation...
## ... and simulations...
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 11%
|
|======== | 12%
|
|======== | 13%
|
|========= | 14%
|
|========== | 15%
|
|========== | 16%
|
|=========== | 17%
|
|============ | 18%
|
|============ | 19%
|
|============= | 20%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 23%
|
|================ | 24%
|
|================ | 25%
|
|================= | 26%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|===================== | 33%
|
|====================== | 34%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 37%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 40%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 43%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 46%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 51%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 54%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 57%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 60%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 63%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 66%
|
|============================================ | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 77%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 80%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 83%
|
|======================================================= | 84%
|
|======================================================= | 85%
|
|======================================================== | 86%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 89%
|
|========================================================== | 90%
|
|=========================================================== | 91%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 94%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 97%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 100%
## Class attributes are accessible through following names:
## series loess.span dt dj Wave.xy Angle sWave.xy sAngle Power.xy Power.xy.avg Power.xy.pval Power.xy.avg.pval Coherency Coherence Coherence.avg Coherence.pval Coherence.avg.pval Wave.x Wave.y Phase.x Phase.y Ampl.x Ampl.y Power.x Power.y Power.x.avg Power.y.avg Power.x.pval Power.y.pval Power.x.avg.pval Power.y.avg.pval sPower.x sPower.y Ridge.xy Ridge.co Ridge.x Ridge.y Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz
Plot the wavelet coherency analysis for winter.
wc.image(winter.wc, main = "cross-wavelet power spectrum, x over y (Winter)",
legend.params = list(lab = "cross-wavelet power levels"),
periodlab = "period (years)", show.date = TRUE)
According to the graph the significant cycles occur every eight to sixteen years. These cycles are relatively short accordind to the map.
Plot the wavelet coherency analysis for spring.
wc.image(spring.wc, main = "cross-wavelet power spectrum, x over y (Spring)",
legend.params = list(lab = "cross-wavelet power levels"),
periodlab = "period (years)", show.date = TRUE)
According to the plot for spring the significant cycles occur every eight, sixteen to thirty four years.
Plot the wavelet coherency analysis for Summer.
wc.image(summer.wc, main = "cross-wavelet power spectrum, x over y (Summer)",
legend.params = list(lab = "cross-wavelet power levels"),
periodlab = "period (years)", show.date = TRUE)
From the graph the significant cycles occur every eight years. The cycles are relatively short according to the graph.
Plot the wavelet coherency analysis for Autumn.
wc.image(autumn.wc, main = "cross-wavelet power spectrum, x over y (Autumn)",
legend.params = list(lab = "cross-wavelet power levels"),
periodlab = "period (years)", show.date = TRUE)
According the the output, significant cycles occur every eight years for Autumn.
Use the following code to calculate the average cycles for winter CET records and NAO . The significant cycles are marked by red points.
wc.avg(winter.wc, siglvl = 0.05, sigcol = 'red',
periodlab = "period (years)", main = "Winter")
From the graph it is clear that the significant cycles for Winter occur every eight to sixteen years, which is indicated by the red dots.
wc.avg(spring.wc, siglvl = 0.05, sigcol = 'red',
periodlab = "period (years)", main = "Spring")
From the output it is clear that the significant cycles for Spring occur every eight years.
wc.avg(summer.wc, siglvl = 0.05, sigcol = 'red',
periodlab = "period (years)", main = "Summer")
From the graph it is evident that the significant cycles for Summer occur every fourteen to eight years.
wc.avg(autumn.wc, siglvl = 0.05, sigcol = 'red',
periodlab = "period (years)", main = "Autumn")
Lastly form the graph, significant cycles for Autumn occur every eight years.