project_pals: Project locations for multiple actors

View source: R/project.R

project_palsR Documentation

Project locations for multiple actors

Description

Computes Projected Actor Locations for a set of actors at one or more prediction times (an actor-by-time grid).

Usage

project_pals(
  events,
  actors = NULL,
  predict_time,
  params,
  alter_weight = c("normalized", "legacy"),
  eps = 0.01,
  cutoff = c("day", "month", "year")
)

Arguments

events

A pal_events object.

actors

Character vector of actor ids. Defaults to all actors in events.

predict_time

A Date or vector of Dates.

params

A pals_params object or a fitted estimate_pals object.

alter_weight

"normalized" (default) uses the paper's normalized alter weights; "legacy" reproduces the original replication code (an un-normalized sum of alter coordinates). See DECISIONS.md.

eps

Numerical offset inside each age weight (default 0.01).

cutoff

History granularity: "day" (default) uses events strictly before predict_time; "month" uses events before the 1st of that month; "year" uses events before Jan 1 of that year (the source's Dec-1 yearly convention). Ages are always measured from predict_time.

Value

A data.frame with columns actor, time, lon, lat, n_focal, n_alter, has_history (one row per actor-time combination).

Examples

ev <- simulate_conflict_events(n_actors = 10, n_events = 300, seed = 1)
p  <- pals_params(alpha = 0.9, beta = 0.2, gamma = -10, eta = -10)
pal <- project_pals(ev, predict_time = as.Date("2010-12-01"), params = p)
head(pal)


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