Skip to content

Commit e5c3dfb

Browse files
committed
fix 0 lag matern
1 parent 5de4b42 commit e5c3dfb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gstatsim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ def covar(effective_lag, sill, nug, vtype, s=None):
615615
c[effective_lag > 1] = sill - 1
616616
elif vtype.lower() == 'matern':
617617
scale = 0.45246434*np.exp(-0.70449189*s)+1.7863836
618+
effective_lag[effective_lag==0.0] = 1e-8
618619
c = (sill-nug)*2/gamma(s)*np.power(scale*effective_lag*np.sqrt(s), s)*kv(s, 2*scale*effective_lag*np.sqrt(s))
619620
c[np.isnan(c)] = sill-nug
620621
else:

0 commit comments

Comments
 (0)