Skip to content

Commit

Permalink
Update diagnostics and bump version (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebodin authored Feb 24, 2021
1 parent ca1652b commit a047701
Show file tree
Hide file tree
Showing 2 changed files with 11 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 = "ScoreDrivenModels"
uuid = "4a87933e-d659-11e9-0e65-7f40dedd4a3a"
authors = ["guilhermebodin <[email protected]>, raphaelsaavedra <[email protected]>"]
version = "0.1.7"
version = "0.1.8"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
12 changes: 10 additions & 2 deletions src/diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ function quantile_residuals(obs::Vector{T}, gas::Model{D, T};

for t in axes(params_fitted[len_ini_par + 1:end - 1, :], 1)
dist = update_dist(D, params_fitted[len_ini_par + 1:end - 1, :], t)
prob = cdf(dist, obs[t + len_ini_par])
quant_res[t] = quantile(Normal(0, 1), prob)
# Continuous distributions PIT
if supertype(D).parameters[2] == Continuous
prob = cdf(dist, obs[t + len_ini_par])
quant_res[t] = quantile(Normal(0, 1), prob)
else # Discrete distributions PIT
lb = cdf(dist, obs[t + len_ini_par] - 1)
ub = cdf(dist, obs[t + len_ini_par])
prob = rand(Uniform(lb, ub))
quant_res[t] = quantile(Normal(0, 1), prob)
end

# Treat possible infinity values
if quant_res[t] == Inf
Expand Down

2 comments on commit a047701

@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/30727

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.1.8 -m "<description of version>" a047701bf4f3671eb92f8954598ed3c564554806
git push origin v0.1.8

Please sign in to comment.