Skip to content

Implemented interface for mark distribution#88

Merged
JoseKling merged 8 commits into
mainfrom
marks
Jun 19, 2026
Merged

Implemented interface for mark distribution#88
JoseKling merged 8 commits into
mainfrom
marks

Conversation

@JoseKling

@JoseKling JoseKling commented May 19, 2026

Copy link
Copy Markdown
Owner

The interface is implemented. Maybe the names can be improved.

What I implemented:

  • An AbstractMarkDistribution type for mark distributions different from the ones in Distributions.jl.
  • PointProcessMarkDistribution alias for Union{AbstractMarkDistribution,Distribution}.
  • The following methods as part of the common interface.
    • mark_distribution -> The distribution of marks at some time t and after history h.
    • sample_mark -> Sample from mark_distribution. Standard implementation assumes the result of mark_distribution has the method rand.
    • densityof -> for mark m at time t after history h. Standard implementation assumes result of mark_distribution has method densityof.
    • fit -> Fit the distribution to a history h. For processes whose event times are independent of the marks.
    • eltype -> Used to initialize empty histories. Standard implementation assumes result of mark_distribution has method eltype.
  • Added the CustomProcesses page to the docs.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

struct IndependentMultivariateProcess{P<:AbstractUnivariateProcess} <: AbstractMultivariateProcess


[JuliaFormatter] reported by reviewdog 🐶

histories = [
time_change(History(h, d), pp.processes[d]) for
d in 1:ndims(pp)
]


[JuliaFormatter] reported by reviewdog 🐶

fit(
proc_types[d],
History(h, d);
kwargs...,
) for d in eachindex(proc_types)


[JuliaFormatter] reported by reviewdog 🐶

return InhomogeneousPoissonProcess{F,NoMarks,C}(
f, NoMarks(), integration_config
)


[JuliaFormatter] reported by reviewdog 🐶

h_temp = History(times, tmin, tmax)


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

InhomogeneousPoissonProcess{PolynomialIntensity{Float64},NoMarks},
h,
[2.0, 0.3],


[JuliaFormatter] reported by reviewdog 🐶

@test md isa PointProcessMarkDistribution


[JuliaFormatter] reported by reviewdog 🐶

@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
src/history.jl 93.75% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@JoseKling JoseKling marked this pull request as ready for review May 26, 2026 08:01
@JoseKling

Copy link
Copy Markdown
Owner Author

In src/univariate/poisson/poisson_process.jl I deleted the methods

  • ground_intensity(pp), ground_intensity(pp, t)
  • intensity(pp, m), intensity(pp, t, m) and log_intensity
  • mark_distribution(pp), mark_distrbution(pp, t)

One reason is they are conceptually incorrect, the intensity is defined as dependent on the history. ground_intensity(pp) is actually the parameter $\lambda$, so it should be accessed with pp.λ.
Second reason is that now that we are supporting custom mark distributions, intensity and mark_distribution cannot be assumed to not depend on t or h.
Lastly, we just unify the interface.

Should we raise a deprecation error or something like that?

@JoseKling JoseKling linked an issue May 26, 2026 that may be closed by this pull request
@JoseKling JoseKling requested a review from rsenne June 2, 2026 20:53
@rsenne

rsenne commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Hi @JoseKling I'll try and take a look at this later in the week

Comment thread src/history.jl Outdated
Comment thread src/history.jl Outdated
Comment thread src/univariate/poisson/simulation.jl Outdated
Comment thread src/mark_distributions.jl Outdated
Comment thread src/PointProcesses.jl Outdated
Comment thread docs/examples/CustomProcesses.jl Outdated
Comment thread docs/examples/CustomProcesses.jl Outdated
Comment thread docs/examples/CustomProcesses.jl Outdated
Comment thread docs/examples/CustomProcesses.jl Outdated
Comment thread docs/examples/CustomProcesses.jl Outdated
Comment thread src/history.jl Outdated
Comment thread src/mark_distributions.jl Outdated
Comment thread src/mark_distributions.jl Outdated
Comment thread src/mark_distributions.jl Outdated
Comment thread src/mark_distributions.jl Outdated
Comment thread src/mark_distributions.jl Outdated
Comment thread src/multivariate/independent_multivariate.jl Outdated
@rsenne

rsenne commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Should we raise a deprecation error or something like that?

I would say until we have evidence for a solid user base for anything like this to just delete as we are pre v1. Anyc hanges we can document (which reminds me, we should keep a changelog)

Comment thread src/history.jl Outdated
Comment thread src/history.jl Outdated
@JoseKling

Copy link
Copy Markdown
Owner Author

about the changelog. Or do you mean something else?

@JoseKling JoseKling changed the title Implemented interface for mark mark distribution Implemented interface for mark distribution Jun 9, 2026
@rsenne

rsenne commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Or do you mean something else?

Related idea, but basically we would house a CHANGELOG.md per the keep a changelog project.

It's basically the same thing but it tends to be more long format. But its not strictly necessary and we can use the same format for releases

@JoseKling

Copy link
Copy Markdown
Owner Author

There are a couple of lines not reached by the tests. Apart from that, any other issues here?

@rsenne

rsenne commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Just updated from main--I can take another look

@rsenne rsenne self-requested a review June 16, 2026 20:33
@rsenne

rsenne commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

@JoseKling there are 5 unresolved comments from above can you take a look at them and let me know if you agree/disagree? (I think they were missed because they were hidden)

- Added tests
- Fixed `CustomProcesses` example in docs
@JoseKling JoseKling merged commit 7a0af3b into main Jun 19, 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.

Struct for mark distributions

2 participants