The R Project SVN R

Rev

Rev 59039 | Rev 65999 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 61160
Line 90... Line 90...
90
plot(x)
90
plot(x)
91
lines(x1, col = "red")    # go long if the short crosses the long upwards
91
lines(x1, col = "red")    # go long if the short crosses the long upwards
92
lines(x2, col = "green")  # and go short otherwise
92
lines(x2, col = "green")  # and go short otherwise
93
 
93
 
94
## More interesting kernels
94
## More interesting kernels
95
kd <- kernel("daniell", c(3,3))
95
kd <- kernel("daniell", c(3, 3))
96
kd # note the unusual indexing
96
kd # note the unusual indexing
97
kd[-2:2]
97
kd[-2:2]
98
plot(kernel("fejer", 100, r=6))
98
plot(kernel("fejer", 100, r = 6))
99
plot(kernel("modified.daniell", c(7,5,3)))
99
plot(kernel("modified.daniell", c(7,5,3)))
100
 
100
 
101
# Reproduce example 10.4.3 from Brockwell and Davis (1991)
101
# Reproduce example 10.4.3 from Brockwell and Davis (1991)
102
spectrum(sunspot.year, kernel=kernel("daniell", c(11,7,3)), log="no")
102
spectrum(sunspot.year, kernel = kernel("daniell", c(11,7,3)), log = "no")
103
}
103
}
104
\keyword{ts}
104
\keyword{ts}
105
 
105