generateRandomPaths: Produce random paths modeled on a given path

View source: R/TrajectoryGeometry.R

generateRandomPathsR Documentation

Produce random paths modeled on a given path

Description

This function takes a path and produces N random paths of the same dimension and length based on it. This can be done either by permuting the entries in path or by taking steps from the initial point of path. Exact behaviour is controlled by randomizationParams.

Usage

generateRandomPaths(
  path,
  from = 1,
  to = nrow(path),
  d = ncol(path),
  randomizationParams,
  N
)

Arguments

path

- This is an mxn dimensional matrix. Each row is considered a point.

from

- The starting place along the path which will be treated as the center of the sphere. This defaults to 1.

to

- The end point of the path. This defaults to nrow(path).

d

- The dimension under consideration. This defaults to ncol(path)

randomizationParams

- A character vector controling the randomization method used. It's first entry must be either 'byPermutation' or 'bySteps' See the vignette for further details.

N

- The number of random paths required.

Value

This function returns a list of random paths. Each path is a matrix.

Examples

randomizationParams = c('byPermutation','permuteWithinColumns')
randomPaths = generateRandomPaths(crooked_path,from=6,to=nrow(crooked_path),
              d=ncol(crooked_path),randomizationParams=randomizationParams,
              N=10)

AnnaLaddach/TrajectoryGeometry documentation built on Oct. 14, 2022, 10:27 a.m.