Skip to content

Commit 966f802

Browse files
authored
Add backend to normcdf and normpdf calls in mixnorm (#100)
1 parent 30b5c4e commit 966f802

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scoringrules/core/crps/_closed.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,12 @@ def mixnorm(
628628
s_X = B.sqrt(s[..., None] ** 2 + s[..., None, :] ** 2)
629629
w_X = w[..., None] * w[..., None, :]
630630

631-
A_y = m_y * (2 * _norm_cdf(m_y / s) - 1) + 2 * s * _norm_pdf(m_y / s)
632-
A_X = m_X * (2 * _norm_cdf(m_X / s_X) - 1) + 2 * s_X * _norm_pdf(m_X / s_X)
631+
A_y = m_y * (2 * _norm_cdf(m_y / s, backend=backend) - 1) + 2 * s * _norm_pdf(
632+
m_y / s, backend=backend
633+
)
634+
A_X = m_X * (2 * _norm_cdf(m_X / s_X, backend=backend) - 1) + 2 * s_X * _norm_pdf(
635+
m_X / s_X, backend=backend
636+
)
633637

634638
sc_1 = B.sum(w * A_y, axis=-1)
635639
sc_2 = B.sum(w_X * A_X, axis=(-1, -2))

0 commit comments

Comments
 (0)