# NOT RUN {
# Spectral Density AR(1)
require(ggplot2)
f <- spectral.density(ar = 0.5, lambda = malleco)
ggplot(data.frame(x = malleco, y = f)) +
geom_line(aes(x = as.numeric(x), y = as.numeric(y))) +
labs(x = "Frequency", y = "Spectral Density") +
theme_minimal()
# }
Run the code above in your browser using DataLab