-
Notifications
You must be signed in to change notification settings - Fork 2
Multivariate History
#77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| 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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| 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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| 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, | |
| ) |
| (tmin, tmax), | ||
| "End of interval must be strictly larger than the start.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| (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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| 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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| return @view h.dims[imin: imax] | |
| return @view h.dims[imin:imax] |
| 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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| 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} |
| (tmin, tmax), | ||
| "End of interval must be strictly larger than the start.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| (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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| end | |
| end | |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Edit: I just realized that the discussion about this PR is in Issue #73 |
Added the parameter
Nto 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.