construct_grid: Computes the location-bandwidth grid for the multiscale test.

View source: R/construct_grid.R

construct_gridR Documentation

Computes the location-bandwidth grid for the multiscale test.

Description

Computes the location-bandwidth grid for the multiscale test.

Usage

construct_grid(t, u_grid = NULL, h_grid = NULL, deletions = NULL)

Arguments

t

Sample size.

u_grid

Vector of location points in the unit interval [0,1]. If NULL, a default grid is used.

h_grid

Vector of bandwidths, each bandwidth is supposed to lie in (0, 0.5). If NULL, a default grid is used.

deletions

Logical vector of the length len(u.grid) * len(h.grid). Each element is either TRUE, which means that the corresponding location-bandwidth point (u, h) is NOT deleted from the grid, or FALSE, which means that the corresponding location-bandwidth point (u, h) IS deleted from the grid. Default is NULL in which case nothing is deleted. See vignette for the use.

Value

A list with the following elements:

gset

Matrix of location-bandwidth points (u, h) that remains after deletions, the i-th row gset[i,] corresponds to the i-th point (u,h).

bws

Vector of bandwidths (after deletions).

lens

Vector of length = length(bws), lens[i] gives the number of locations in the grid for the i-th bandwidth level.

gtype

Type of grid that is used, either 'default' or 'non-default'.

gset_full

Matrix of all location-bandwidth pairs (u, h) including deleted ones.

pos_full

Logical vector indicating which points (u, h) have been deleted.

Examples

construct_grid(100)
construct_grid(100, u_grid = seq(from = 0.05, to = 1, by = 0.05),
               h_grid = c(0.1, 0.2, 0.3, 0.4))

MSinference documentation built on Sept. 11, 2024, 5:38 p.m.