Skip to content

Commit

Permalink
Merge branch 'master' into compathelper/new_version/2024-02-29-00-08-…
Browse files Browse the repository at this point in the history
…46-910-02046243722
  • Loading branch information
yebai authored Mar 1, 2024
2 parents a1276f5 + 2bc717c commit a6bcd00
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sampler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,14 @@ function initialize_parameters!!(
vi = invlink!!(vi, spl, model)
end
theta = vi[spl]
length(theta) == length(init_theta) ||
error("Provided initial value doesn't match the dimension of the model")
length(theta) == length(init_theta) || throw(
DimensionMismatch(
"Provided initial value size ($(length(init_theta))) doesn't match the model size ($(length(theta)))",
),
)

# Update values that are provided.
for i in 1:length(init_theta)
for i in eachindex(init_theta)
x = init_theta[i]
if x !== missing
theta[i] = x
Expand Down

0 comments on commit a6bcd00

Please sign in to comment.