Learn R Programming

tensorBSS (version 0.3.9)

tensorBoot: Bootstrapping or Permuting a Data Tensor

Description

The function takes bootstrap samples or permutes its content along the last dimension of the tensor.

Usage

tensorBoot(x, replace = TRUE)

Value

The bootstrapped or permuted samples in an array with the same dimension as x.

Arguments

x

Array of an order of at least two with the last dimension corresponding to the sampling units.

replace

Logical. Should sampling be performed with or without replacement.

Author

Christoph Koesner

Details

Assume an array of dimension \(r+1\), where the last dimension represents the \(n\) sampling units and the first \(r\) dimensions the data per unit. The function then returns an array of the same dimension as x where either \(n\) bootstraps samples are selected or the units are permuted.

Examples

Run this code
x <- array(1:50, c(2, 5, 5))
x
tensorBoot(x)
tensorBoot(x, replace = FALSE)

x <- array(1:100, c(2, 5, 2, 5))
x
tensorBoot(x)

Run the code above in your browser using DataLab