Skip to content

Commit

Permalink
Return nearly singular x0 if perturbation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jlperla committed Aug 16, 2022
1 parent 3c07b98 commit 6b60ff5
Show file tree
Hide file tree
Showing 2 changed files with 5 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 = "DifferentiableStateSpaceModels"
uuid = "beacd9db-9e5e-4956-9b09-459a4b2028df"
authors = ["Jesse Perla <jesseperla@gmail.com> and contributors"]
version = "0.5.0"
version = "0.5.1"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
6 changes: 4 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ function FirstOrderPerturbationSolution(retcode, m::PerturbationModel, c::Solver
make_covariance_matrix(c.Ω),
c.Q,
c.η,
(settings.calculate_ergodic_distribution == true) ?
(settings.calculate_ergodic_distribution ==
true && retcode == :Success) ?
c.V :
diagm(settings.singular_covariance_value *
ones(m.n_x)),
Expand Down Expand Up @@ -520,7 +521,8 @@ function SecondOrderPerturbationSolution(retcode, m::PerturbationModel, c::Solve
make_covariance_matrix(c.Ω),
c.Q,
c.η,
(settings.calculate_ergodic_distribution == true) ?
(settings.calculate_ergodic_distribution ==
true && retcode == :Success) ?
c.V :
diagm(settings.singular_covariance_value *
ones(m.n_x)),
Expand Down

2 comments on commit 6b60ff5

@jlperla
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/66366

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.5.1 -m "<description of version>" 6b60ff5e130709ef386edaaa8700de82c5d21832
git push origin v0.5.1

Please sign in to comment.