Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a forecasting recipe #223

Merged
merged 3 commits into from
Dec 14, 2020
Merged

Added a forecasting recipe #223

merged 3 commits into from
Dec 14, 2020

Conversation

guilhermebodin
Copy link
Member

#170 I think we could benefit from some simple plot recipes, no more searching how to make a proper ribbon.

Maybe we can even define more recipes for scenarios and components in the future.

Look what have I done in a feel lines

using StateSpaceModels, CSV, DataFrames, Plots
nile = CSV.read(StateSpaceModels.NILE, DataFrame)
model = LocalLevel(nile.flow)
fit!(model)
forec = forecast(model, 24)
plot(model, forec)

air_passengers = CSV.read(StateSpaceModels.AIR_PASSENGERS, DataFrame)
log_air_passengers = log.(air_passengers.passengers)
model = BasicStructural(log_air_passengers, 12)
fit!(model)
forec = forecast(model, 24)
plot(model, forec; legend = :topleft)

Captura de Tela 2020-12-13 às 20 07 36

Captura de Tela 2020-12-13 às 20 05 56

@codecov
Copy link

codecov bot commented Dec 13, 2020

Codecov Report

Merging #223 (cb0ae70) into master (4f510fe) will increase coverage by 0.04%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #223      +/-   ##
==========================================
+ Coverage   91.59%   91.63%   +0.04%     
==========================================
  Files          22       23       +1     
  Lines        1499     1531      +32     
==========================================
+ Hits         1373     1403      +30     
- Misses        126      128       +2     
Impacted Files Coverage Δ
src/StateSpaceModels.jl 100.00% <ø> (ø)
src/visualization/forecast.jl 93.75% <93.75%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f510fe...cb0ae70. Read the comment docs.

@raphaelsaavedra
Copy link
Member

I'm not familiar with RecipesBase, what's the difference between this and simply extending plot?

@guilhermebodin
Copy link
Member Author

You don't need to have Plots.jl as a dependency.

@raphaelsaavedra
Copy link
Member

Other than a small detail which I'm not sure is necessary, looks good to me!

@guilhermebodin
Copy link
Member Author

@guilhermebodin guilhermebodin merged commit 60f64a7 into master Dec 14, 2020
@guilhermebodin guilhermebodin deleted the vizualization branch December 17, 2020 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants