Skip to content

Commit

Permalink
🤖 Format .jl files (#27)
Browse files Browse the repository at this point in the history
Co-authored-by: juliohm <[email protected]>
  • Loading branch information
github-actions[bot] and juliohm authored Oct 10, 2024
1 parent 4e420b9 commit fb4e883
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/matrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end
function _probmatrix(dom, vals, minlag)
# transition counts
C = _countmatrix(dom, vals, minlag)

# Laplace smoothing
C .+= 1

Expand Down
9 changes: 6 additions & 3 deletions test/matrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

# base transition rate matrix
R = GeoStatsFunctions.baseratematrix([1.0, 2.0, 3.0]u"m", [0.2, 0.5, 0.3])
@test R == [-1/1.0 0.5/(1-0.2)/1.0 0.3/(1-0.2)/1.0;
0.2/(1-0.5)/2.0 -1/2.0 0.3/(1-0.5)/2.0;
0.2/(1-0.3)/3.0 0.5/(1-0.3)/3.0 -1/3.0] * u"m^-1"
@test R ==
[
-1/1.0 0.5 / (1 - 0.2)/1.0 0.3 / (1 - 0.2)/1.0
0.2 / (1 - 0.5)/2.0 -1/2.0 0.3 / (1 - 0.5)/2.0
0.2 / (1 - 0.3)/3.0 0.5 / (1 - 0.3)/3.0 -1/3.0
] * u"m^-1"
end

0 comments on commit fb4e883

Please sign in to comment.