Skip to content

Review Changes - #96

Merged
JoseKling merged 1 commit into
MultivariateHawkesfrom
review-fixes-92
Aug 8, 2026
Merged

JoseKling merged 1 commit into
MultivariateHawkesfrom
review-fixes-92

Conversation

@rsenne

@rsenne rsenne commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

hey @JoseKling i found a few more things on #92 during review but I don;t want to keep holding it up so I'm doing a stacked PR here with some proposed changes. Sorry this has taken me so long. I think these all make sense but let me know if anything is afoot. I've approved #92 so this can be the next PR after

Bug fixes:

  • simulate(::PoissonProcess, tmin, tmax) started its first inter-arrival at 0
    instead of tmin, so simulating on an interval with tmin != 0 produced events
    outside [tmin, tmax) and a positive log-density.
  • simulate(::PoissonProcess, ...) and simulate_ogata sampled marks through the
    rng-less sample_mark, so seeded simulations were not reproducible in their marks.
  • event_times(h, d) ignored d for univariate histories while event_marks(h, d)
    did not. History(h, d) combines both and passes check_args=false, so
    History(univariate_h, 2) silently returned a history whose times and marks had
    different lengths. Both accessors now agree, and History(h, d) validates d.
  • The inner History constructor coerced dims .= nothing when N == 1, which
    throws a convert MethodError for integer dims and mutates the caller's vector
    for Union{Nothing,Int} dims. It now validates instead of coercing.
  • The generic multivariate time_change sized its buffers by ndims(h) but looped
    over 1:ndims(pp), giving a BoundsError when the process had more dimensions
    than the history. Mismatched dimensions now throw a DimensionMismatch.

JET:

  • fit(::Type{<:Distribution}, ::History) and fit(::Type{<:AbstractPointProcess}, ::History) intersect at Type{Union{}}, so inference put a Distribution in the
    return-type union of fit(PP, h), which is what JET was reporting. Adding a
    Type{Union{}} method removes it, so the ::AbstractPointProcess assertion in
    MonteCarloTest (which turned the inference gap into a possible runtime
    TypeError) is no longer needed.

Docs:

  • The multivariate interface docstring listed integrated_ground_intensity(pp, t, h, d)
    and required simulate(pp, h)
  • The interface docstrings in abstract_point_process.jl documented the multivariate
    methods as (pp, h, t, d), but the code takes (pp, t, h, d).
  • mark_distribution was declared and documented twice, so the first docstring was
    discarded with a Replacing docs warning during precompilation. Merged into one.
  • Restored the time_change(h, Λ) docstring, without which @docs time_change in
    api.md rendered the InhomogeneousPoissonProcess method under History.
  • Documented the current History constructor forms, including that a plain vector
    of times always builds a univariate history.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mark_distributions.jl 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@JoseKling JoseKling left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@JoseKling
JoseKling merged commit 0011e91 into main Aug 8, 2026
4 of 5 checks passed
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