You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of time_change for inhomogeneous Poisson processes should be fallback for AbstractPointProcess. Fallback for integrated_ground_intensity can also de defined from ground_intensity.
Something along these lines
functionintegrated_ground_intensity(pp::AbstractPointProcess, h::History, a, b)
func = (t, p) ->ground_intensity(pp, t, h)
prob =IntegralProblem(func, a, b);
sol =solve(prob, QuadGKJL(); abstol =1e-14, reltol =1e-14);
return sol.u;
endfunctiontime_change(h::History, pp::AbstractPointProcess)
edges =vcat(h.tmin, h.times, h.tmax)
deltas = [integrated_ground_intensity(pp, h, edges[i], edges[i +1]) for i in1:(length(edges) -1)]
T =eltype(deltas)
i_neg =findfirst(<(zero(T)), deltas)
if i_neg !==nothingthrow(
DomainError(
deltas[i_neg],
""" time_change: integrated intensity over [$(edges[i_neg]), $(edges[i_neg +1])] is negative. This could mean: 1. Intensity function is negative. 2. Incorrect implementation of integrated_ground_intensity. 3. Floating-point jitter from adaptive quadrature on an interval where the true integral is near zero."""
),
)
end
cs =cumsum(deltas)
new_times = cs[1:(end-1)]
new_tmax = cs[end]
returnHistory(; times=new_times, tmin=zero(T), tmax=new_tmax, marks=h.marks)
end
Activity
JoseKling commentedon May 20, 2026
If we think a bit there should also be a simple way to make some fallback for the
fitmethod too, usingOptim.