# influence: Influence Functions In siplab: Spatial Individual-Plant Modelling

## Description

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

## Usage

 ```1 2 3 4 5 6 7 8``` ```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. Points x-coordinates minus plant x-coordinate. `dy` Vector of y-distances. Points y-coordinates minus plant y-coordinate. `marks` Plant mark information. `par` List of parameters.

## Details

The values of `par` must be given in the argument `infpar` of `assimilation`, they are shown here as examples.

`smark` in `par` indicates the location of the plant size variable in `marks`. It can be a data frame column number, or a string id like "height".

Let S be the plant size, and R be the Euclidean plant-to-point distance R = sqrt(dx^2 + dy^2). Then the 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/b)^a - R^a]^(1/a)}

`gnomon.inf`:

max{0, S - b R^a}

## Value

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

Oscar García.

## References

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.

`assimilation`
 ``` 1 2 3 4 5 6 7 8 9 10``` ```# 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) } ```