lagr.tune: Estimate the bandwidth parameter for a lagr model

Description Usage Arguments Details Value

View source: R/lagr.tune.r

Description

lagr.tune estimates the bandwidth parameter for a LAGR model.

Usage

1
2
3
4
5
6
7
8
lagr.tune(formula, data, family = gaussian(), range = NULL,
  weights = NULL, coords, oracle = NULL, kernel = NULL,
  bw.type = c("dist", "knn", "nen"), varselect.method = c("AIC", "BIC",
  "AICc", "jacknife", "wAIC", "wAICc"), verbose = FALSE, longlat = FALSE,
  tol.loc = .Machine$double.eps^0.25, tol.bw = .Machine$double.eps^0.25,
  bwselect.method = c("AIC", "AICc", "GCV", "BIC"),
  lambda.min.ratio = 0.001, n.lambda = 50, lagr.convergence.tol = 0.001,
  lagr.max.iter = 20, na.action = na.fail, contrasts = NULL)

Arguments

formula

symbolic representation of the model

data

data frame containing observations of all the terms represented in the formula

family

exponential family distribution of the response

range

allowable range of the bandwidth

weights

vector of prior observation weights (due to, e.g., overdispersion). Not related to the kernel weights.

coords

matrix of locations, with each row giving the location at which the corresponding row of data was observed

kernel

kernel function for generating the local observation weights

bw.type

type of bandwidth - options are dist for distance (the default), knn for nearest neighbors (bandwidth a proportion of n), and nen for nearest effective neighbors (bandwidth a proportion of the sum of squared residuals from a global model)

varselect.method

criterion to minimize in the regularization step of fitting local models - options are AIC, AICc, BIC, GCV

verbose

print detailed information about our progress?

longlat

TRUE indicates that the coordinates are specified in longitude/latitude, FALSE indicates Cartesian coordinates. Default is FALSE.

tol.loc

local error tolerance for converting an adaptive bandwidth (e.g. knn or nen) to a distance

tol.bw

global error tolerance for minimizing the bandwidth selection criterion

bwselect.method

criterion to minimize when tuning bandwidth - options are AICc, BICg, and GCV

fit.loc

matrix of locations where the local models should be fitted

bw

bandwidth for the kernel

tuning

logical indicating whether this model will be used to tune the bandwidth, in which case only the tuning criteria are returned

a

pre-specified matrix of distances between locations

Details

This method calls lagr repeatedly via the optimize function, searching for the bandwidth that minimizes a bandwidth selection criterion. It returns the profiled value of the selection criterion at each bandwidth that is used in the evaluation.

Value

list(bw, trace) where bw minimizes the bandwidth selection criterion and trace is a data frame of each bandwidth that was tried during the optimization, along with the resulting degrees of freedom used inthe LAGR model and the value of the bandwidth selection criterion.


wrbrooks/lagr documentation built on May 4, 2019, 11:59 a.m.