Skip to content

Compare Multi-Window-Finder window estimates in a notebook - #1236

Closed
karthiksenv wants to merge 1 commit into
stumpy-dev:mainfrom
karthiksenv:codex/multi-window-finder-notebook
Closed

karthiksenv wants to merge 1 commit into
stumpy-dev:mainfrom
karthiksenv:codex/multi-window-finder-notebook

Conversation

@karthiksenv

Copy link
Copy Markdown
Contributor

Refs #1062.

The notebook compares Algorithm 1 with the authors’ reference code on two synthetic signals with known periods and the first 8,192 samples of UCR series 001. On the UCR excerpt, switching from sum(log(r)) to log(sum(r)) changes the estimate from 37.50 to 210.00 samples with the grid, trimming, and weights held fixed. Keeping the paper score and averaging all harmonic estimates gives 90.08 samples.

All six code cells ran successfully. The reference scores matched the authors’ implementation on all three inputs.

@seanlaw @NimaSarajpoor, could you review the comparison, especially the two readings of the divisor in Algorithm 1, line 9?

Pull Request Checklist

Below is a simple checklist but please do not hesitate to ask for assistance!

  • Read our Contributing Guide
  • Referenced a Github issue (or create one if one doesn't already exist)
  • Read and reviewed all of the comments in the Github issue that you've referenced (along with cross-referenced issues/pull requests) to ensure that the issue still requires a pull request
  • Checked that the issue has not already been assigned to anybody else or is already being addressed in another pull request
  • Left a meaningful comment on the original Github issue to discuss the detailed approach for your contribution and received confirmation from the maintainers before proceeding with this pull request
  • Forked, cloned, and checked out the newest version of the code
  • Created a new branch
  • Made necessary code changes
  • Installed black (i.e., python -m pip install black or conda install -c conda-forge black)
  • Installed flake8 (i.e., python -m pip install flake8 or conda install -c conda-forge flake8)
  • Installed pytest-cov (i.e., python -m pip install pytest-cov or conda install -c conda-forge pytest-cov)
  • Ran black --exclude=".*\.ipynb" --extend-exclude=".venv" --diff ./ in the root stumpy directory
  • Ran flake8 --extend-exclude=.venv ./ in the root stumpy directory
  • Ran ./setup.sh dev && ./test.sh in the root stumpy directory and ensured that all tests are passing locally
  • Check this box if AI code assistance was used to generate
    • less than 25% of the code in this pull request
    • 25-50% of the code in this pull request
    • more than 50% of the code in this pull request

Please do not commit any code to avoid/circumvent a failing test and, instead, engage in a discussion (below) to determine the best course of action.

Only request a review after the checklist above is fully completed!

@karthiksenv
karthiksenv requested a review from seanlaw as a code owner November 18, 2026 19:47
@gitnotebooks

gitnotebooks Bot commented Nov 18, 2026

Copy link
Copy Markdown

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1236

@seanlaw

seanlaw commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@karthiksenv Before submitting a PR, you'll need to share an assessment on the concerns mentioned in #1062 (comment) and #1062 (comment). If the decisions made by the original authors seem hardcoded/brittle for other datasets then we should not continue. The goal isn't to make a notebook just to have it. One must be able to defend and justify the robustness of their approach for any input data. If it is not possible, then we can close the issue instead.

@karthiksenv

Copy link
Copy Markdown
Contributor Author

Thanks, Sean. I should have shared the assessment first. I don't think we should continue this PR, and I'd support closing #1062.

The paper's quantity can be negative, so it should be called a score; exact zero residuals also produce -inf. With the grid, trimming, and weights fixed, the UCR excerpt gives 37.50 samples for sum(log(r)) versus 210.00 for log(sum(r)). That excerpt has no ground-truth window, so this shows sensitivity without establishing which formula is correct.

The normalization concern also holds up. The authors' function gives 80.92 for 100 repetitions of an 83-sample motif, but 50.00 after applying 100*x + 100 to the last 50 repetitions. The motif is sin(2*pi*t/83) + 0.35*cos(4*pi*t/83), with t=0,...,82, using windows 10 through 1000 in steps of 10. The original and transformed motifs match after individual z-normalization. Constant input and a linear ramp both raise IndexError.

I couldn't find a justification in the paper or reference notebook for the fixed three-valley weights (0.8, 0.15, 0.05). Changing them would need independent validation; the current examples don't establish robustness across datasets.

@seanlaw seanlaw closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants