Skip to content

Commit

Permalink
Add test for warning on low number of observations in model fitting
Browse files Browse the repository at this point in the history
  • Loading branch information
yanwenwang24 committed Nov 13, 2024
1 parent 90f753a commit 0f269a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ using Statistics
model = LCAModel(2, n_items, fill(2, n_items))
ll = fit!(model, data)

# Test warning for number of observations
@test_logs (:warn, "Low number of observations (100) may affect model fitting. Consider using more data for better results.") begin
fit!(model, data)
end

# Test results
@test !isnan(ll)
@test !isinf(ll)
Expand Down

0 comments on commit 0f269a4

Please sign in to comment.