Skip to content

Multivariate linear regression with gaussian mixture pool #446

Answered by bvdmitri
max-de-rooij asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, I looked into it, and it does seem strange. However, I think I identified the main issue.

  1. Index Out of Bounds Error

In the example you shared, the code didn’t run at all because the individuals array contained indices larger than the length of α, causing an out-of-bounds error when accessing α[individuals[i]]. I fixed this by mapping individuals to a valid range:

map_individuals = Dict()
counter = 1
foreach(individuals) do individual
    if !haskey(map_individuals, individual)
        map_individuals[individual] = counter
        global counter += 1
    end
end
fixed_individuals = map(i -> map_individuals[i], individuals)

I then used fixed_individuals instead of individuals in the …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@max-de-rooij
Comment options

@bvdmitri
Comment options

@max-de-rooij
Comment options

@bvdmitri
Comment options

Answer selected by max-de-rooij
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants