Learn R Programming

FlywayNet (version 0.1.0)

get_freeparametersvalue: Extract free parameter values from a migration structure.

Description

Get values of free parameters. Indeed taking into account sites order, known impossible sites links, sites dead probability, not all the sites transition probabilities have to be estimated. Others parameters values may be evaluated from free parameters.

Usage

get_freeparametersvalue(
  migr,
  update_transitions = TRUE,
  update_sojourns = NULL,
  use_adhoc_dirichlet = FALSE
)

Arguments

migr

A migration structure.

update_transitions

If TRUE, transitions are considered unknown and their values should be returned.

update_sojourns

Vector of boolean, that identifies which sojourn times should be returned.

use_adhoc_dirichlet

If TRUE, the transition probabilities are given in the ad hoc Dirichlet distribution (\(q_ij\) values). See details.

Value

return named vector of default values of parameters to estimate.

Details

Let N be number of sites, \(d_i\) the death probability at a given site i, \(p_ij\) the transition probability from site i to site j. Then we must have a multinomial probability distribution that respects : \(p_i1 + ... + p_iN + di = 1\). Drawing \(p_i1\), ..., \(p_iN\) so that this set of values forms a multinomial distribution can be done with the multivariate Dirichlet distribution which is difficult to handle in estimation processes (especially ABC). The adhoc dirichlet proposed here is a way to provide a bijection between a multinomial distribution and a a set of uniform distribution in [0:1]. This way, from N values \(q_ij\) drawn uniformely in [0:1], we can compute \(p_ij\) with the constraint of the multinomial distribution. And inversely, if we have the multinomial distribution then we can compute uniquely the \(q_ij\) values. A way to do it is to define recursively the \(p_ij\) values as $$p_ij = q_ij * (1- d_i - p_i1 - ... - p_i(j-1))$$

Also, the \(d_i\) values are expected to be known and the last probability transition from one site i (eg. \(p_iN\)) can be computed from others \(p_ij\) and \(d_i\). Finally, the 'link_knowledge' identifies the transitions that are not possible (with probability 0) which are also removed from the extraction.

Examples

Run this code
# NOT RUN {
 migr <- generate_toy_migration()
 get_freeparametersvalue(migr) 
# }

Run the code above in your browser using DataLab