Skip to content
Snippets Groups Projects
Commit 97a90d52 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Set b0 to 0 and s0 to list of 0s by default

parent 0f50808c
No related branches found
No related tags found
No related merge requests found
...@@ -330,8 +330,7 @@ class SqDistAlgorithm(Algorithm): ...@@ -330,8 +330,7 @@ class SqDistAlgorithm(Algorithm):
raise AlgorithmException("l0 must be a scalar") raise AlgorithmException("l0 must be a scalar")
if b0 is None: if b0 is None:
b = (np.nanmean(yobs[m:2 * m]) - np.nanmean(yobs[0:m])) / m b = 0
b = 0 if np.isnan(b) else b # replace NaN with 0
else: else:
b = b0 b = b0
if not np.isscalar(b0): if not np.isscalar(b0):
...@@ -345,8 +344,7 @@ class SqDistAlgorithm(Algorithm): ...@@ -345,8 +344,7 @@ class SqDistAlgorithm(Algorithm):
raise AlgorithmException("yhat0 must have length %d" % hstep) raise AlgorithmException("yhat0 must have length %d" % hstep)
if s0 is None: if s0 is None:
s = [yobs[i] - l for i in range(m)] s = [0 for i in range(m)]
s = [i if ~np.isnan(i) else 0 for i in s] # replace NaNs with 0s
else: else:
s = list(s0) s = list(s0)
if len(s) != m: if len(s) != m:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment