28.6 1749-2013 年太阳黑子数据

再从官网拿到最近的数据

plot(sunspot.month, xlab = "Year", ylab = "Monthly sunspot numbers",
     main = "Monthly mean relative sunspot numbers from 1749 to 2013")

autoplot(sunspot.month,
  main = "Monthly mean relative sunspot numbers from 1749 to 2013",
  xlab = "Year", ylab = "Monthly sunspot numbers"
)
时序图:太阳黑子月均数量时序图:太阳黑子月均数量

图 28.2: 时序图:太阳黑子月均数量

autoplot(sunspots)

autoplot(sunspot.year, xlab = "Year", ylab = "Yearly Sunspot Data, 1700-1988") +
  theme_minimal()
太阳黑子数量年平均时序图

图 28.3: 太阳黑子数量年平均时序图

library(dygraphs)
hw <- HoltWinters(sunspot.month)
predicted <- predict(hw, n.ahead = 72, prediction.interval = TRUE)

dygraph(predicted, main = "Predicted sunspot numbers") %>%
  dyAxis("x", drawGrid = FALSE) %>%
  dySeries(c("lwr", "fit", "upr"), label = "sunspot") %>%
  dyOptions(colors = hcl.colors(3))
par(family = "source-han-sans-cn")
plot(sunspot.month, col = "black")
lines(sunspots, col = "red")
legend("topright", legend = c("1749 至今", "1749-1983"), col = c("black", "red"), lty = 1)
月均太阳黑子数

图 28.4: 月均太阳黑子数