Skip to content

Commit

Permalink
Merge pull request #319 from LAMPSPUC/gb/fix_smooth_trend
Browse files Browse the repository at this point in the history
fix smooth trend
  • Loading branch information
guilhermebodin authored Aug 28, 2023
2 parents fb60be8 + ca97fd5 commit bca817f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StateSpaceModels"
uuid = "99342f36-827c-5390-97c9-d7f9ee765c78"
authors = ["raphaelsaavedra <raphael.saavedra93@gmail.com>, guilhermebodin <guilherme.b.moraes@gmail.com>, mariohsouto"]
version = "0.6.6"
version = "0.6.7"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
2 changes: 1 addition & 1 deletion src/models/unobserved_components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ function initial_hyperparameters!(model::UnobservedComponents)
if model.has_irregular
initial_hyperparameters["sigma2_irregular"] = observed_variance
end
if model.has_trend
if model.stochastic_trend
initial_hyperparameters["sigma2_trend"] = observed_variance
end
if model.has_cycle
Expand Down
2 changes: 1 addition & 1 deletion test/models/sarima.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Values are very close to 0.0 so we test with absolute tolerance
# It attains 1e-3 when we make 10M simulations, which is too much
# computation for a rather simple test.
test_scenarios_adequacy_with_forecast(forec, scenarios; atol=1e-1)
test_scenarios_adequacy_with_forecast(forec, scenarios; atol=2e-1)

missing_obs = [6, 16, 26, 36, 46, 56, 66, 72, 73, 74, 75, 76, 86, 96]
missing_dinternet = copy(dinternet)
Expand Down
5 changes: 5 additions & 0 deletions test/models/unobserved_components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@
@test minimum(alpha[:, 1]) <= 296
@test maximum(alpha[:, 2]) >= 7.5
@test minimum(alpha[:, 2]) <= -7.5

# Testing that it does not break
rj_temp = CSV.File(StateSpaceModels.RJ_TEMPERATURE) |> DataFrame
model = UnobservedComponents(rj_temp.Values; trend = "smooth trend", cycle = "stochastic")
fit!(model)
end

2 comments on commit bca817f

@guilhermebodin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/90399

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.7 -m "<description of version>" bca817f2db2e9094269cf8582ab011fe8bb7b467
git push origin v0.6.7

Please sign in to comment.