migrate_raster: Migrate the Quantities in a Raster.

Description Usage Arguments Value

Description

This applies a migration operation to a given Raster* object.

Usage

1
2
3
4
migrate_raster(x, migration = list(sigma = 1, normalize = 1, n.weights = 1),
  kern = migration$kern, sigma = migration$sigma,
  radius = migration$radius, normalize = migration$normalize,
  n.weights = migration$n.weights)

Arguments

x

The Raster* to apply the migration operation to.

migration

The migration object containing the relevant parameters, which may alternatively be passed in individually.

kern

Weighting kernel applied to distances.

sigma

Distance scaling for kernel.

radius

Maximum distance away to truncate the kernel.

normalize

Normalize the kernel so that the total sum of weights is equal to this; pass NULL to do no normalization.

n.weights

The resulting operator is x -> (1-sum(n.weights)) * x + n.weights[1] * M x + n.weights[2] * M^2 x + ...

Value

A Raster* of the same form as the input. If the factor normalize is NULL then the result is approximately stochastic, but may be pretty far off if the discretization is very coarse. It is exactly stochastic if normalize is 1; the interpretation of normalize more generally is the total production per unit of x.

However, note that even if normalize is 1, the migration will still not be conservative at any raster cells nearby to boundary or NA cells.

The weights in n.weights should sum to less than 1.

It is not necessarily possible to do exactly the same thing with migrate() and with migrate_raster(). One difference is that this function takes local averages, which does not preserve mass, whereas migrate(), with normalize=1, does preserve mass.


petrelharp/landsim documentation built on May 25, 2019, 2:53 a.m.