We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a020171 commit 2bc717cCopy full SHA for 2bc717c
src/sampler.jl
@@ -158,11 +158,14 @@ function initialize_parameters!!(
158
vi = invlink!!(vi, spl, model)
159
end
160
theta = vi[spl]
161
- length(theta) == length(init_theta) ||
162
- error("Provided initial value doesn't match the dimension of the model")
+ length(theta) == length(init_theta) || throw(
+ DimensionMismatch(
163
+ "Provided initial value size ($(length(init_theta))) doesn't match the model size ($(length(theta)))",
164
+ ),
165
+ )
166
167
# Update values that are provided.
- for i in 1:length(init_theta)
168
+ for i in eachindex(init_theta)
169
x = init_theta[i]
170
if x !== missing
171
theta[i] = x
0 commit comments