Skip to content

Commit

Permalink
initialize_position_params_from_assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Petukhov committed Jun 4, 2024
1 parent 148b03a commit 0adc489
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/processing/data_processing/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ function initial_distributions(df_spatial::DataFrame, initial_params::InitialPar
return components, sampler, initial_params.assignment
end

function initialize_position_params_from_assignment(pos_data::Matrix{Float64}, cell_assignment::Vector{Int})
centers = cell_centers_from_assignment(pos_data, cell_assignment);
covs = covs_from_assignment(pos_data, cell_assignment);
adjust_cov_matrix!.(covs);

return MvNormalF.(centers, covs);
end

# Utils

# This function is a determenistic analogue of sampling. It picks points in a manner that preserves the distributions across x and y.
Expand Down

0 comments on commit 0adc489

Please sign in to comment.