genSample: Generate a sample of points in dimension \$p\$. In gMOIP: Tools for 2D and 3D Plots of Single and Multi-Objective Linear/Integer Programming Models

Description

Generate a sample of points in dimension \$p\$.

Usage

 1 2 3 4 5 6 7 8 9 genSample( p, n, range = c(1, 100), random = FALSE, sphere = TRUE, box = FALSE, ... )

Arguments

 p Dimension of the points. n Number of samples generated. range The range of the points in each dimension (a vector or matrix with p rows). random Random sampling. sphere Generate points on a sphere. box Generate points in boxes. ... Further arguments passed on to the method for generating points. This must be done as lists (see examples). Currently the following arguments are supported: argsSphere: A list of arguments for generating points on a sphere: radius: The radius of the sphere. center: The center of the sphere. plane: The plane used. below: Either true (generate points below the plane), false (generate points above the plane) or NULL (generated on the whole sphere). factor: If using a plane. Then the factor to multiply n with, so generate enough points below/above the plane. closeToPlane: If TRUE only return points close to the plane. argsBox: A list of arguments for generating points inside boxes: intervals: Number of intervals to split the length of the range into. That is, each range is divided into intervals (sub)intervals and only the lowest/highest subrange is used. cor: How to correlate indices. If 'idxAlt' then alternate the intervals (high/low) for each dimension. For instance if p = 3 and the first dimension is in the high interval range then the second will be in the low interval range and third in the high interval range again. If idxRand then choose the low/high interval range for each dimension based on prHigh. If idxSplit then select floor(p/2):ceiling(p/2) dimensions for the high interval range and the other for the low interval range. prHigh: Probability for choosing the high interval range in each dimension.

Details

Note having ranges with different length when using the sphere method, doesn't make sense. The best option is properly to use a center and radius here. Moreover, as for higher p you may have to use a larger radius than half of the desired interval range.

Value

A data frame with p columns