File tree Expand file tree Collapse file tree
ParetoSmootherImportanceSampling Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [deps ]
2+ Statistics = " 10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Original file line number Diff line number Diff line change @@ -32,17 +32,17 @@ arXiv preprint arXiv:1507.02646.
3232
3333module ParetoSmoothedImportanceSampling
3434
35- using StatsFuns
35+ using StatsFuns, Statistics
3636
3737psis_path = @__DIR__
3838
3939include (" psisloo.jl" )
4040include (" psislw.jl" )
4141include (" gpdfitnew.jl" )
4242include (" gpinv.jl" )
43- # include("logsumexp.jl")
4443include (" waic.jl" )
4544include (" pk_utilities.jl" )
45+ include (" dic.jl" )
4646
4747export
4848 psis_path
Original file line number Diff line number Diff line change 1+
2+ """
3+ dic(loglike::AbstractVector{<:Real})
4+
5+ Computes Deviance Information Criterion (DIC).
6+
7+ # Arguments
8+ * `log_lik::AbstractArray`: Array of size n x m containing n posterior samples of the log likelihood terms p(y_i|\t heta^s).
9+
10+ # Returns
11+ * `dic::Real`: DIC value
12+ """
13+ function dic (loglike:: AbstractVector{<:Real} )
14+ D = deviance .(loglike)
15+ return mean (D) + 0.5 * var (D)
16+ end
17+
18+ deviance (loglikelihood:: Real ) = - 2 * loglikelihood
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments