Last data update: 2014.03.03

R: A specific version of the function gwr
gwr.cvR Documentation

A specific version of the function gwr

Description

A specific version of the function gwr returning only the leave-one-out Cross Validation (CV) score. gwr.cv exludes the observation for which a sub-model fits.

Usage

gwr.cv(bw, formula, dframe, obs, kernel, dmatrix)

Arguments

bw

a positive number that may be an integer in the case of an "adaptive kernel" or a real in the case of a "fixed kernel". In the first case the integer denotes the number of nearest neighbours, whereas in the latter case the real number refers to the bandwidth (in meters if the coordinates provided are Cartesian). This argument can be also the result of a bandwidth selection algorithm such as those available in the function gwr.bw

formula

the local model to be fitted using the same syntax used in the lm function in R. This is a sting that is passed to the sub-models' lm function. For more details look at the class formula.

dframe

a numeric data frame of at least two suitable variables (one dependent and one independent)

obs

number of observations in the global dataset

kernel

the kernel to be used in the regression. Options are "adaptive" or "fixed". The weighting scheme used here is defined by the bi-square function (weight = (1-(ndist/H)^2)^2 for distances less than or equal to H, 0 otherwise)

dmatrix

eucledian distance matrix between the observations

Details

Only used by gwr.bw

Value

Leave-one-out Cross Validation (CV) score

Author(s)

Stamatis Kalogirou <skalo@hua.gr>

References

Fotheringham, A.S., Brunsdon, C., Charlton, M. (2000). Geographically Weighted Regression: the analysis of spatially varying relationships. John Wiley and Sons, Chichester.

Kalogirou, S. (2003) The Statistical Analysis And Modelling Of Internal Migration Flows Within England And Wales, PhD Thesis, School of Geography, Politics and Sociology, University of Newcastle upon Tyne, UK.

See Also

gwr.bw gwr

Results