Learn R Programming

greta (version 0.2.0)

dynamics-module: methods for modelling structured dynamical systems

Description

A module providing functions specific to dynamical modelling. So far only for iterating Leslie matrices. iterate_lambda iterates a matrix a certain number of times and returns, as a scalar greta array, the terminal growth rate for the first element of the state vector. iterate_state carries out the same procedure, but returns the final state vector. iterate_lambda_vectorised is a vectorised version of iterate_lambda for iterating over multiple matrices, returning a vector of growth rates.

Arguments

matrix

a square, two-dimensional (i.e. matrix-like) greta array representing transition probabilities between states

state

a column vector greta array representing the initial state from which to iterate the matrix

niter

a positive integer giving the number of times to iterate the matrix

matrices

a rectangular two-dimensional greta array of dimension n x m^2, each row of which gives the rowwise elements of a different m x m matrix to iterate

n

the number of m x m matrices to be iterated (first dimensions of matrices)

m

the dimension of each matrix to be iterated

Usage

  dynamics$iterate_lambda(matrix, state, niter)
  dynamics$iterate_state(matrix, state, niter)
  dynamics$iterate_lambda_vectorised(matrices, state, n, m, niter)