Skip to contents

Compute the marginal probability map from a graph. The computation uses the forward backward algorithm. For more details, see section 2.3.2 of Nussbaumer et al. (2023b) and the GeoPressureManual.

Usage

graph_marginal(graph, quiet = FALSE)

Arguments

graph

a GeoPressureR graph with defined movement model graph_set_movement().

quiet

logical to hide messages about the progress.

Value

A list of the marginal maps for each stationary period (even those not modelled). Best to include within tag.

References

Nussbaumer, Raphaël, Mathieu Gravey, Martins Briedis, Felix Liechti, and Daniel Sheldon. 2023. Reconstructing bird trajectories from pressure and wind data using a highly optimized hidden Markov model. Methods in Ecology and Evolution, 14, 1118–1129 https://doi.org/10.1111/2041-210X.14082.

Examples

setwd(system.file("extdata", package = "GeoPressureR"))
tag <- tag_create("18LX", quiet = TRUE) |>
  tag_label(quiet = TRUE) |>
  twilight_create() |>
  twilight_label_read() |>
  tag_set_map(
    extent = c(-16, 23, 0, 50),
    known = data.frame(stap_id = 1, known_lon = 17.05, known_lat = 48.9)
  ) |>
  geopressure_map(quiet = TRUE) |>
  geolight_map(quiet = TRUE)

# Create graph
graph <- graph_create(tag, quiet = TRUE)

# Define movement model
graph <- graph_set_movement(graph)

# Compute marginal
marginal <- graph_marginal(graph)
#>  Compute movement model
#>  Compute movement model [926ms]
#> 
#>  Compute marginal
#>  All done
#>  Compute marginal

#>  Compute marginal [188ms]
#> 

plot(marginal)