Skip to content

Commit

Permalink
Refactor baseratematrix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Nov 1, 2024
1 parent 2e7c36d commit ad4ee45
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/theoretical/transiogram/matrixexponential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,5 @@ function baseratematrix(l, p)
end

# Eq. 17 and 18 of Carle et al 1998.
map(Iterators.product(1:nₗ, 1:nₗ)) do (i, j)
if i == j
-1 / l[i]
else
(p[j] / (1 - p[i])) / l[i]
end
end
SMatrix{nₗ,nₗ}(i == j ? -1 / l[i] : (p[j] / (1 - p[i])) / l[i] for i in 1:nₗ, j in 1:nₗ)
end

0 comments on commit ad4ee45

Please sign in to comment.