|
1 | 1 | """
|
2 |
| - fit!(model::LCAModel, data::Matrix{Int}; |
3 |
| - max_iter::Int=1000, tol::Float64=1e-6, verbose::Bool=false) |
| 2 | + fit!(model::LCAModel, data::AbstractMatrix{<:Integer}; |
| 3 | + max_iter::Integer=1000, tol::Real=1e-6, verbose::Bool=false) |
4 | 4 |
|
5 | 5 | Fit the LCA model using EM algorithm.
|
6 | 6 |
|
7 | 7 | # Arguments
|
8 | 8 | - `model::LCAModel`: Model to fit
|
9 |
| -- `data::Matrix{Int}`: Prepared data matrix |
10 |
| -- `max_iter::Int=1000`: Maximum number of iterations |
11 |
| -- `tol::Float64=1e-6`: Convergence tolerance |
| 9 | +- `data::AbstractMatrix{<:Integer}`: Prepared data matrix |
| 10 | +- `max_iter::Integer=1000`: Maximum number of iterations |
| 11 | +- `tol::Real=1e-6`: Convergence tolerance |
12 | 12 | - `verbose::Bool=false`: Whether to print progress
|
13 | 13 |
|
14 | 14 | # Returns
|
15 | 15 | - `Float64`: Final log-likelihood
|
16 | 16 | """
|
17 | 17 |
|
18 | 18 | function fit!(
|
19 |
| - model::LCAModel, data::Matrix{Int}; |
20 |
| - max_iter::Int=10000, tol::Float64=1e-6, verbose::Bool=false |
| 19 | + model::LCAModel, data::AbstractMatrix{<:Integer}; |
| 20 | + max_iter::Integer=10000, tol::Real=1e-6, verbose::Bool=false |
21 | 21 | )
|
22 | 22 | # Validate data dimensions
|
23 | 23 | n_obs, n_items = size(data)
|
|
0 commit comments