influence: Influence Functions

influenceR Documentation

Influence Functions

Description

Compute influence values depending on distance and plant marks, for use in assimilation().

Note: In previous versions of siplab the function names had .inf in place of _inf.

Usage

zoi_inf(dx, dy, marks, par = list(k = 0.2, smark = 1))

tass_inf(dx, dy, marks, par = list(b = 3.52 * 0.975, c = 6.1,
    smark = 1))

gates_inf(dx, dy, marks, par = list(a = 1, b = 4, smark = 1))

gnomon_inf(dx, dy, marks, par = list(a = 1, b = 4, smark = 1))

Arguments

dx

Vector of x-distances. Coordinates x for a number of points minus coordinate x of the subjectt plant.

dy

Vector of y-distances. Coordinates y for a number of points minus coordinate y of the subjectt plant.

marks

Mark data for the subject plant.

par

List of parameters.

Details

The user can program her/his own influence function. It must take the arguments dx, dy, marks, and optionally par.

Influence function values are normally non-negative. Otherwise, they are set to 0 in assimilation().

The values of par are taken from the argument infpar of assimilation(), if not NULL. Otherwise the default is used.

smark in par must be 1 or “mark” if there is only one mark. If the marks are a data frame, smark must be the number or name of the column with the plant size variable.

Let S be the plant size, and R be the Euclidean plant-to-point distance R = sqrt(dx^2 + dy^2). Then the built-in influence functions are:

zoi_inf():

1 if R < k S, 0 otherwise

tass_inf():

max{0, S - c[exp(R/b) - 1]}

gates_inf():

max{0, [S^a - (bR)^a]^(1/a)}

gnomon_inf():

max{0, S - b R^a}

Other influence functions can be written following these examples.

Value

Vector of influence values, of length equal to the length of dx and dy.

Author(s)

Oscar García.

References

https://github.com/ogarciav/siplab

García, O. “A generic approach to spatial individual-based modelling and simulation of plant communities”. Mathematical and Computational Forestry and Nat.-Res. Sci. (MCFNS) 6(1), 36-47. 2014.

See Also

assimilation

Examples

# Example multi-species influence function (spruce/hardwoods)
multi_inf <- function (dx, dy, marks, par) {
    out <- numeric(length(dx))
    s <- marks$SPECIES == "Spruce"
    out[s] <- gnomon_inf(dx[s], dy[s], marks[s, ], par=list(a=par$aS,
        b=par$bS, smark=par$smark))
    out[!s] <- gnomon_inf(dx[!s], dy[!s], marks[!s, ], par=list(a=par$aH,
        b=par$bH, smark=par$smark)) # Hardwoods
    return(out)
}

siplab documentation built on March 18, 2022, 6:53 p.m.