MakeGrid: Grid Construction

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/MakeGrid.R

Description

Computes a grid of points on the interval (0,1). This function is useful for constructing the "alpha-grid" used in various r-value computations.

Usage

1
MakeGrid(nunits, type = "log", ngrid = NULL, lower = 1/nunits, upper = 1 - lower)

Arguments

nunits

The number of units in the data for which r-values are to be calculated.

type

The type of grid; type can be set to type="uniform", type="log", or type="log.symmetric".

ngrid

a number specifying the number of grid points

lower

the smallest grid point; must be greater than zero

upper

the largest grid point; must be less than one

Details

If nunits ≤ 1000, the default number of grid points is equal to nunits. When nunits > 1000, the default number of grid points is determined by

1000 + 25*log(nunits - 1000)*(nunits - 1000)^{1/4}

.

Value

A vector of grid points in (0,1).

Author(s)

Nicholas Henderson and Michael Newton

See Also

rvalues

Examples

1
2
3
4
5
alpha.grid <- MakeGrid(1000,type="uniform",ngrid=200)

log.grid <- MakeGrid(40,type="log")
log.grid
hist(log.grid)

Example output

 [1] 0.02500000 0.02746228 0.03016707 0.03313825 0.03640207 0.03998735
 [7] 0.04392575 0.04825204 0.05300444 0.05822490 0.06395953 0.07025898
[13] 0.07717886 0.08478029 0.09313039 0.10230290 0.11237882 0.12344713
[19] 0.13560557 0.14896150 0.16363288 0.17974926 0.19745295 0.21690030
[25] 0.23826305 0.26172983 0.28750788 0.31582483 0.34693076 0.38110034
[31] 0.41863531 0.45986715 0.50515996 0.55491370 0.60956774 0.66960471
[37] 0.73555479 0.80800037 0.88758118 0.97500000

rvalues documentation built on March 11, 2021, 9:05 a.m.

Related to MakeGrid in rvalues...