@@ -51,13 +51,13 @@ julia> # Sample!
51
51
chain_type=Chains, num_warmup, progress=false, initial_params=zeros(2)
52
52
);
53
53
54
- julia> isapprox(cov(Array(chain)), model.A ; rtol = 0.2)
54
+ julia> isapprox(cov(Array(chain)), model.Σ ; rtol = 0.2)
55
55
true
56
56
```
57
57
58
58
It's also possible to restrict the eigenvalues to avoid either too small or too large values. See p. 13 in [^VIH12].
59
59
60
- ```jldoctest ram-gaussian`
60
+ ```jldoctest ram-gaussian
61
61
julia> chain = sample(
62
62
model,
63
63
RobustAdaptiveMetropolis(eigenvalue_lower_bound=0.1, eigenvalue_upper_bound=2.0),
@@ -144,7 +144,7 @@ function ram_step_inner(
144
144
lp = state. logprob
145
145
lp_new = LogDensityProblems. logdensity (f, x_new)
146
146
logα = min (lp_new - lp, zero (lp)) # `min` because we'll use this for updating
147
- isaccept = randexp (rng) > - logα
147
+ isaccept = Random . randexp (rng) > - logα
148
148
149
149
return x_new, lp_new, U, logα, isaccept
150
150
end
@@ -159,14 +159,14 @@ function ram_adapt(
159
159
S = state. S
160
160
# TODO : Make this configurable by defining a more general path.
161
161
η = state. iteration^ (- sampler. γ)
162
- ΔS = η * abs (Δα) * S * U / norm (U)
162
+ ΔS = η * abs (Δα) * S * U / LinearAlgebra . norm (U)
163
163
# TODO : Maybe do in-place and then have the user extract it with a callback if they really want it.
164
164
S_new = if sign (Δα) == 1
165
165
# One rank update.
166
- LinearAlgebra. lowrankupdate (Cholesky (S), ΔS). L
166
+ LinearAlgebra. lowrankupdate (LinearAlgebra . Cholesky (S), ΔS). L
167
167
else
168
168
# One rank downdate.
169
- LinearAlgebra. lowrankdowndate (Cholesky (S), ΔS). L
169
+ LinearAlgebra. lowrankdowndate (LinearAlgebra . Cholesky (S), ΔS). L
170
170
end
171
171
return S_new, η
172
172
end
@@ -190,8 +190,8 @@ function AbstractMCMC.step(
190
190
initial_params === nothing ? rand (rng, T, d) :
191
191
convert (AbstractVector{T}, initial_params)
192
192
# Initialize the Cholesky factor of the covariance matrix.
193
- S = LowerTriangular (
194
- sampler. S === nothing ? diagm (0 => ones (T, d)) :
193
+ S = LinearAlgebra . LowerTriangular (
194
+ sampler. S === nothing ? LinearAlgebra . diagm (0 => ones (T, d)) :
195
195
convert (AbstractMatrix{T}, sampler. S),
196
196
)
197
197
0 commit comments