Time Series: Johnson & Johnson Quarterly Earnings Per Share, 84 Quarters, 1960 I To 1980 IV
Time Series: Johnson & Johnson Quarterly Earnings Per Share, 84 Quarters, 1960 I To 1980 IV
plot(jj, type="o",
ylab="Quarterly Earnings per Share",
main="Johnson & Johnson quarterly earnings per share,
\n84 quarters, 1960-I to 1980-IV.")
grid()
10
5
0
Time
head(globtemp)
1
plot(globtemp, type="o",
ylab="Global Temperature Deviations",
main="Yearly average global temperature deviations
\n(1880–2015) in degrees centigrade.")
grid()
0.4
0.0
−0.4
Time
head(speech)
plot(speech,
main="Speech recording of the syllable aaa hhh
\nsampled at 10,000 points per second
with n = 1020 points.")
grid()
# library(TTR)
# djia = getYahooData("ˆDJI", start=20060420, end=20160420, freq="daily")
library(xts)
##
## Attaching package: ’zoo’
2
## The following objects are masked from ’package:base’:
##
## as.Date, as.Date.numeric
2000
1000
0
Time
## Close
## 2006-04-21 0.0004019814
## 2006-04-24 -0.0009813081
## 2006-04-25 -0.0046924330
## 2006-04-26 0.0062939559
## 2006-04-27 0.0024646652
## 2006-04-28 -0.0013512402
## 2006-05-01 -0.0021003229
## 2006-05-02 0.0064289317
## 2006-05-03 -0.0014173744
## 2006-05-04 0.0033784210
3
DJIA Returns 2006−04−21 / 2016−04−20
0.10 0.10
0.05 0.05
0.00 0.00
−0.05 −0.05
Apr 21 2006 Apr 01 2008 Apr 01 2010 Apr 02 2012 Apr 01 2014 Mar 31 2016
lines(djiar)
4
DJIA Returns 2006−04−21 / 2016−04−20
0.10 0.10
0.05 0.05
0.00 0.00
−0.05 −0.05
Apr 21 2006 Apr 01 2008 Apr 01 2010 Apr 02 2012 Apr 01 2014 Mar 31 2016
## [1] 0.377 0.246 0.311 0.104 -0.016 0.235 0.137 0.191 -0.016 0.290
5
Southern Oscillation Index
1.0
0.5
0.0
−0.5
−1.0
head(rec,10)
## [1] 68.63 68.63 68.63 68.63 68.63 68.63 59.16 48.70 47.54 50.91
6
Recruitment
100
80
60
40
20
0
#par(mfrow=c(2,1))
head(fmri1)
ts.plot(fmri1[,2:5], col=1:4,
ylab="BOLD", main="Cortex")
grid()
7
Cortex
0.2 0.4 0.6
BOLD
−0.2
−0.6
0 20 40 60 80 100 120
Time
ts.plot(fmri1[,6:9], col=1:4,
ylab="BOLD", main="Thalamus & Cerebellum")
grid()
8
Thalamus & Cerebellum
0.6
0.4
0.2
BOLD
−0.2 0.0
−0.6
0 20 40 60 80 100 120
Time
#par(mfrow=c(2,1))
head(EQ5)
plot(EQ5, main="Earthquake")
grid()
9
Earthquake
0.4
0.2
EQ5
0.0
−0.4 −0.2
Time
head(EXP6)
plot(EXP6, main="Explosion")
grid()
10
Explosion
0.4
0.2
EXP6
0.0
−0.4 −0.2
Time
#par(mfrow=c(2,1))
plot.ts(w, main="white noise")
grid()
11
white noise
3
2
1
0
w
−1
−2
−3
−4
Time
12
moving average
3
2
1
0
v
−1
−2
−3
Time
plot.ts(x, main="autoregression")
grid()
13
autoregression
5
x
0
−5
Time
head(xd)
14
random walk
50
40
30
20
10
0
Time
head(cs)
plot.ts(cs, main=expression(2*cos(2*pi*t/50+.6*pi)))
grid()
15
2cos(2πt 50 + 0.6π)
2
1
cs
0
−1
−2
Time
head(cs+w)
16
2cos(2πt 50 + 0.6π) + N(0, 1)
4
2
cs + w
0
−2
−4
Time
head(cs+5*w)
17
2cos(2πt 50 + 0.6π) + N(0, 25)
15
10
cs + 5 * w
5
0
−5
−15
Time
x = rnorm(100)
y = lag(x, -5) + rnorm(100)
head(y)
18
y&x
1.0
0.6
CCovF
0.2
−0.2
−15 −10 −5 0 5 10 15
Lag
19