Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #85 from parevalo/issue84
Browse files Browse the repository at this point in the history
Skip commission if n <= k #84
  • Loading branch information
ceholden committed Apr 11, 2016
2 parents a0c9510 + 0bb561b commit cacb2cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions yatsm/algorithms/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ def commission_test(yatsm, alpha=0.10):
m_r_start = m_1_start
m_r_end = m_2_end

# Need enough obs to fit models (n > k)
if (m_1_end - m_1_start) <= k or (m_2_end - m_2_start) <= k:
logger.debug('Too few obs (n <= k) to merge segment')
merged = False
if i == 0:
models.append(m_1)
models.append(m_2)
continue

n = m_r_end - m_r_start
F_crit = scipy.stats.f.ppf(1 - alpha, k, n - 2 * k)

Expand Down

0 comments on commit cacb2cf

Please sign in to comment.