Skip to content

Commit 48f9994

Browse files
authored
Merge pull request #141 from mwien/master
Bound log argument
2 parents b48fb66 + 8484ed0 commit 48f9994

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ges.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function local_score_(os::GaussianScore, p, v)
362362
c = @view C[p, v]
363363
Cp = C[v, v] - dot(c, (@view C[p, p])\c)
364364
end
365-
(-n*(1 + log(Cp)) - penalty*(1 + k)*log(n))/2
365+
(-n*(1 + log(max(0,Cp))) - penalty*(1 + k)*log(n))/2
366366
end
367367

368368

@@ -390,7 +390,7 @@ hash(a::GaussianScoreQR, u::UInt) = hash(a.hash, u)
390390
x = @view X[:, p]
391391
Cp = var(y - x*(x\y); mean=0.0, corrected=false)
392392
end
393-
(-n*(1 + log(Cp)) - penalty*(1 + k)*log(n))/2
393+
(-n*(1 + log(max(0,Cp))) - penalty*(1 + k)*log(n))/2
394394
end
395395

396396

0 commit comments

Comments
 (0)