Skip to content

Commit

Permalink
Added check in F-test for enough ndf
Browse files Browse the repository at this point in the history
  • Loading branch information
JackWalpole committed Dec 1, 2017
1 parent 2b02bbc commit c0ef4d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions splitwavepy/core/core.py
Expand Up @@ -215,6 +215,11 @@ def ftest(lam2,ndf,alpha=0.05):
by default alpha = 0.05 = 95% confidence interval
following Silver and Chan (1991)
"""

# check ndf is big enough
if ndf < 3:
raise Exception('Number of degrees of freedom is less than 3. This likely indicates a problem which would lead to a spurios mesaurement. Check window length.')

lam2min = lam2.min()
k = 2 # two parameters, phi and dt.
F = stats.f.ppf(1-alpha,k,ndf)
Expand Down

0 comments on commit c0ef4d2

Please sign in to comment.