Skip to content

Commit

Permalink
Use asinh
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Dec 7, 2024
1 parent 229ea4c commit c43d2e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bijectors/corr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ function _link_chol_lkj(W::AbstractMatrix)
@inbounds for j in 1:K
remainder_sq = W[j, j]^2
for i in (j - 1):-1:1
remainder_sq += W[i, j]^2
z = W[i, j] / sqrt(remainder_sq)
y[i, j] = atanh(z)
y[i, j] = asinh(z)
remainder_sq += W[i, j]^2
end
for i in j:K
y[i, j] = 0
Expand All @@ -323,9 +323,9 @@ function _link_chol_lkj_from_upper(W::AbstractMatrix)
remainder_sq = W[j, j]^2
for i in (j - 1):-1:2
idx = starting_idx + i - 2
remainder_sq += W[i, j]^2
z = W[i, j] / sqrt(remainder_sq)
y[idx] = atanh(z)
y[idx] = asinh(z)
remainder_sq += W[i, j]^2
end
starting_idx += length((j - 1):-1:2)
end
Expand Down

0 comments on commit c43d2e8

Please sign in to comment.