Skip to content

Conversation

@JoseKling
Copy link
Owner

Added the parameter N to history, indicating the number of marginal processes in the multivariate point process. Added methods to access the marginal histories and counts.

Virtually no change in implementation was necessary for univariate processes to keep working as before.

Added the parameter `N` to history, indicating the number of marginal
processes in the multivariate point process.  Added methods to access
the marginal histories and counts.

Virtually no change in implementation was necessary for univariate
processes to keep working as before.
append!(sim, sim_desc)
sort!(sim)
return History(; times=sim, tmin=tmin, tmax=tmax, check=false)
return History(sim, tmin, tmax, check_args=false)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return History(sim, tmin, tmax, check_args=false)
return History(sim, tmin, tmax; check_args=false)


# Type parameter for `HawkesProcess` was NOT explicitly provided
function StatsAPI.fit(HP::Type{HawkesProcess}, h::History{H,M}; kwargs...) where {H<:Real,M}
function StatsAPI.fit(HP::Type{<:HawkesProcess}, h::UnivariateHistory{H,M}; kwargs...) where {H<:Real,M}
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function StatsAPI.fit(HP::Type{<:HawkesProcess}, h::UnivariateHistory{H,M}; kwargs...) where {H<:Real,M}
function StatsAPI.fit(
HP::Type{<:HawkesProcess}, h::UnivariateHistory{H,M}; kwargs...
) where {H<:Real,M}

end
end
end
function History{N}(times::Vector{<:Real}, tmin::Real, tmax::Real, marks::Vector, dims::Vector{<:Int}; check_args::Bool=true) where {N}
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function History{N}(times::Vector{<:Real}, tmin::Real, tmax::Real, marks::Vector, dims::Vector{<:Int}; check_args::Bool=true) where {N}
function History{N}(
times::Vector{<:Real},
tmin::Real,
tmax::Real,
marks::Vector,
dims::Vector{<:Int};
check_args::Bool=true,
) where {N}

new{N,T,M,D}(times, tmin, tmax, marks, dims)
end

function History{1}(times::Vector{<:Real}, tmin::Real, tmax::Real, marks::Vector, ::Any; check_args::Bool=true)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function History{1}(times::Vector{<:Real}, tmin::Real, tmax::Real, marks::Vector, ::Any; check_args::Bool=true)
function History{1}(
times::Vector{<:Real},
tmin::Real,
tmax::Real,
marks::Vector,
::Any;
check_args::Bool=true,
)

Comment on lines +50 to +51
(tmin, tmax),
"End of interval must be strictly larger than the start.",
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
(tmin, tmax),
"End of interval must be strictly larger than the start.",
(tmin, tmax), "End of interval must be strictly larger than the start."

function event_marks(h::History, a, b)
imin = searchsortedfirst(h.times, a)
imax = searchsortedfirst(h.times, b) - 1
return @view h.marks[imin: imax]
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return @view h.marks[imin: imax]
return @view h.marks[imin:imax]

function event_dims(h::History, a, b)
imin = searchsortedfirst(h.times, a)
imax = searchsortedfirst(h.times, b) - 1
return @view h.dims[imin: imax]
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return @view h.dims[imin: imax]
return @view h.dims[imin:imax]

Comment on lines +266 to +267
nb_events(h::History{1}, a, b, ::Int) = nb_events(h, a ,b)
function nb_events(h::History{N}, a, b, d::Int) where {N}
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
nb_events(h::History{1}, a, b, ::Int) = nb_events(h, a ,b)
function nb_events(h::History{N}, a, b, d::Int) where {N}
nb_events(h::History{1}, a, b, ::Int) = nb_events(h, a, b)
function nb_events(h::History{N}, a, b, d::Int) where {N}

Comment on lines +409 to +410
(tmin, tmax),
"End of interval must be strictly larger than the start.",
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
(tmin, tmax),
"End of interval must be strictly larger than the start.",
(tmin, tmax), "End of interval must be strictly larger than the start."

throw(ArgumentError("All event dimensions must lie between 1 and N"))
end
end
end No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 74.46809% with 36 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/history.jl 73.52% 36 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jucheval
Copy link
Collaborator

jucheval commented Jan 16, 2026

Edit: I just realized that the discussion about this PR is in Issue #73

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.

3 participants