project_pal: Project the location of a single actor

View source: R/project.R

project_palR Documentation

Project the location of a single actor

Description

Computes the Projected Actor Location (PAL) for one actor at one or more prediction times, given a parameter set.

Usage

project_pal(
  events,
  actor,
  predict_time,
  params,
  alter_weight = c("normalized", "legacy"),
  eps = 0.01,
  cutoff = c("day", "month", "year")
)

Arguments

events

A pal_events object.

actor

The focal actor id (length-1 character).

predict_time

A Date (or vector of Dates) at which to project. Only events strictly earlier than each prediction time are used.

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 one row per prediction time and columns actor, time, lon, lat, n_focal, n_alter, has_history. lon/lat are NA when the actor has no prior events.

Examples

ev <- simulate_conflict_events(n_actors = 8, n_events = 200, seed = 1)
p  <- pals_params(alpha = 0.9, model = "one")
project_pal(ev, actor = "G01", predict_time = as.Date("2010-12-01"), params = p)


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