You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -57,23 +59,31 @@ not exist and if tail index k>1 the mean of the raw estimate does not exist
57
59
and the PSIS estimate is likely to have large variation and some bias.
58
60
59
61
# Arguments
60
-
* `log_lik::AbstractArray`: Array of size n x m containing n posterior samples of the log likelihood terms p(y_i|\theta^s).
62
+
* `log_lik::Union{AbstractArray, Mamba.Chains}`: Array of size n x m containing n posterior samples of the log likelihood terms p(y_i|\theta^s).
61
63
* `wcpp::Real`: Percentage of samples used for GPD fit estimate (default is 20).
62
64
* `wtrunc::Float64`: Positive parameter for truncating very large weights to n^wtrunc. Providing False or 0 disables truncation. Default values is 3/4.
63
65
64
66
# Returns
65
67
* `loo::Real`: sum of the leave-one-out log predictive densities.
# compute Pareto smoothed log weights given raw log weights
72
-
lw, ks =psislw(lw, wcpp, wtrunc)
73
-
# compute
74
-
lw+=log_lik
75
-
loos =logsumexp(lw, 1)
81
+
lwp, ks =psislw(-lw, wcpp, wtrunc)
82
+
83
+
lwp+=lw
84
+
loos =logsumexp(lwp, 1)
76
85
loo =sum(loos)
86
+
77
87
return loo, loos, ks
78
88
end
79
89
@@ -83,27 +93,40 @@ end
83
93
Compute the Pareto smoothed importance sampling (PSIS).
84
94
85
95
# Arguments
86
-
* `lw::AbstractArray`: Array of size n x m containing m sets of n log weights. It is also possible to provide one dimensional array of length n.
96
+
* `lw::Union{AbstractArray, Mamba.Chains}`: Array of size n x m containing m sets of n log weights. It is also possible to provide one dimensional array of length n.
87
97
* `wcpp::Real`: Percentage of samples used for GPD fit estimate (default is 20).
88
98
* `wtrunc::Float64`: Positive parameter for truncating very large weights to n^wtrunc. Providing False or 0 disables truncation. Default values is 3/4.
0 commit comments