# NOT RUN {
# Fits a local level model for the Nile data
library(datasets)
y <- matrix(Nile)
fit <- StateSpaceFit(initial = 1, y = y / 100, local_level_ind = TRUE)
# Obtain forecasts for 10 steps ahead using the fitted model
fc <- StateSpaceForecast(fit, forecast_period = 10)
# Plot the forecasts
plot(1:10, fc$y_fc * 100, type = 'l')
# }
Run the code above in your browser using DataLab