File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,16 @@ function AbstractMCMC.step(
194
194
convert (AbstractVector{T}, initial_params)
195
195
end
196
196
# Initialize the Cholesky factor of the covariance matrix.
197
- S = LinearAlgebra. LowerTriangular (
198
- sampler. S === nothing ? LinearAlgebra. diagm (0 => ones (T, d)) :
199
- convert (AbstractMatrix{T}, sampler. S),
200
- )
197
+ S_data if sampler. S === nothing
198
+ LinearAlgebra. diagm (0 => ones (T, d))
199
+ else
200
+ # Check the dimensionality of the provided `S`.
201
+ if size (sampler. S) != (d, d)
202
+ throw (ArgumentError (" The provided `S` has the wrong dimensionality." ))
203
+ end
204
+ convert (AbstractMatrix{T}, sampler. S)
205
+ end
206
+ S = LinearAlgebra. LowerTriangular (S_data)
201
207
202
208
# Construct the initial state.
203
209
lp = LogDensityProblems. logdensity (f, x)
You can’t perform that action at this time.
0 commit comments