predict.pals_fit: Project locations from a fitted PALS model

View source: R/estimate.R

predict.pals_fitR Documentation

Project locations from a fitted PALS model

Description

Project locations from a fitted PALS model

Usage

## S3 method for class 'pals_fit'
predict(
  object,
  newdata = NULL,
  predict_time = NULL,
  type = c("pal", "event"),
  actors = NULL,
  ...
)

Arguments

object

A pals_fit from estimate_pals.

newdata

Optional pal_events (for type = "pal") or target data.frame with actor1, actor2, time (for type = "event"). Defaults to the fitted events.

predict_time

For type = "pal", a Date (or vector) at which to project.

type

"pal" projects per-actor locations; "event" predicts dyadic event locations (mean of the two actors' PALs).

actors

For type = "pal", which actors to project (default: all).

...

Unused.

Value

A data.frame of projections (see project_pals / predict_event_locations).

Examples

ev  <- simulate_conflict_events(n_actors = 8, n_events = 200, seed = 1)
fit <- estimate_pals(ev, model = "one")
predict(fit, predict_time = as.Date("2013-12-01"), type = "pal")[1:5, ]


palsr documentation built on July 1, 2026, 5:07 p.m.