Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

71_pooling

Pooling


Description

Pooling functions for matrices.

POOLING AND CONVOLUTION FUNCTIONS ARE ONLY EARLY PROTOTYPES.
THEY HAVE HAD LIMITED TESTING AND MAY BE CHANGED IN FUTURE UPDATES.

Usage

vt2.pool.matrix (x, nsub, ..., f=mean, edge.method="exact")
vt2.pool2.matrix (x, ntar, ..., f=mean)

Arguments

x

A matrix.

nsub

An integer of length two, giving the size of the submatrices.

ntar

An integer vector of length two. The preferred return matrix size.
(Currently, this is not exact, but should be in the future).

f

A function of a matrix.
This matrix will be a submatrix of the matrix x.

edge.method

String, either "exact" or "spart". Refer to details.

...

Ignored.

Details

These functions partition a matrix into a set of smaller matrices.
(The submatrices do not overlap).

In the pool function the user specifies the submatrix size, and in the pool2 function the user specifies the (approx) target size.

In the "exact" edge method, the input matrix needs to divisible into equally sized matrices.
An error is produced if this is not possible.

In the "spart" edge method, smaller equal or near-equal sized matrices are used for edge cases.

Value

A matrix.

See Also

Examples

x <- matrix (1:40, 4, 10)
vt2.pool.matrix (x, c (2, 2) )

vectools

Advanced Vector Toolkit

v0.2.0
GPL (>= 2)
Authors
Abby Spurdle
Initial release
2020-10-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.