Learn R Programming

FlywayNet (version 0.1.0)

estimate_migration_from_trajectories: Estimates migration parameters using trajectories.

Description

Estimates migration parameters using trajectories.

Usage

estimate_migration_from_trajectories(
  migr,
  trajectories,
  estimate_transitions = TRUE,
  estimate_sojourns = TRUE,
  sojourn_domain = NULL,
  min_prob = 0
)

Arguments

migr

A migration structure. Required migration fields are: site_name, link_knowledge, flight_duration, initial_state, horizon, death_probability, observations. Field transition_law_param is also required if the attribute estimate_transitions is set to FALSE or the start_transitions argument is set to NULL. Field sojourn_law_param is also required if the argument estimate_sojourns contains boolean values set to FALSE or if start_sojourns is set to NULL.

trajectories

A matrix of birds trajectories.

estimate_transitions

If TRUE, transitions probabilities are estimated. Default value is TRUE.

estimate_sojourns

Vector of bool, identifies states for which sojourn mean times must be estimated. Default value is TRUE transformed in TRUE for every site except for the last one.

sojourn_domain

Range (min and max) of the sojourn mean time parameters. Possible values: (i) NULL, all intervals are set to [0, migr$horizon], (ii) vector of 2 values min and max then all domains are [min, max] interval, (iii) list of interval for each site. Note that are taken into account only intervals for sites with TRUE in estimate_sojourn arguments. Default value is NULL.

min_prob

A threshold on the minimal value of the transition probabilities. Used, for example, in MCEM to avoid degeneracy. Default is 0.

Value

The migration structure given with a new attribute estimation_method which is a structure with 3 attributes:

. name = "from_trajectories",

. settings, a structure with attributes: estimate_transitions, estimate_sojourns,

. output, a structure with attributes:

- transition_law_param: estimated transition parameters,

- sojourn_law_param: estimated sojourn parameters.

Examples

Run this code
# NOT RUN {
migr <- generate_toy_migration()
traj <- generate_trajectories( migr )
estimated_migr <- estimate_migration_from_trajectories( migr, traj ) 
print( estimated_migr$estimation_method$output$transition_law_param )
# }

Run the code above in your browser using DataLab