Skip to contents

Plots observed data, fitted model, and forecast with optional confidence bounds.

Usage

# S3 method for class 'nhpp_predict'
plot(x, conf_bounds = TRUE, legend = TRUE, legend_pos = "topleft", ...)

Arguments

x

An object of class nhpp_predict.

conf_bounds

Logical; include confidence bounds (default: TRUE).

legend

Logical; show the legend (default: TRUE).

legend_pos

Position of the legend (default: "topleft").

...

Additional arguments passed to plot().

Value

Invisibly returns NULL.

Examples

time <- c(200, 400, 600, 800, 1000)
event <- c(3, 5, 4, 7, 6)
fit <- nhpp(time, event)
fc <- predict_nhpp(fit, time = c(1500, 2000))
plot(fc, main = "NHPP Forecast", xlab = "Time", ylab = "Cumulative Events")