gwfa_score_cv: Calculate leave-one-out cross validation of scores to specify...

Description Usage Arguments Value Author(s) References

Description

This function finds the leave-one-out cross validation of scores to specify bandwidth for GWFA. It can be used to construct the bandwidth function across all possible bandwidths and compared to that found automatically via bw_gwfa function.

Usage

1
2
gwfa_score_cv(bw, x, dp.locat,k, robust, scores,  elocat=NULL, kernel, adaptive=TRUE, 
p, theta, longlat, dMat, vars, n.obs = NA,  fm, rotate, oblique.scores, timeout, foreach)

Arguments

bw

bandwidth used in the weighting function;fixed (distance) or adaptive bandwidth(number of nearest neighbours)

Description from GWmodel::gwpca.cv

x

Same as GWmodel::gwpca. A Spatial*DataFrame, i.e. SpatialPointsDataFrame or SpatialPolygonsDataFrame as defined in package sp.

dp.locat

Same as GWmodel::gwpca.cv. A two-column numeric array of observation coordinates

k

Same as GWmodel::gwpca.cv. The number of retained components; k must be less than the number of variables

robust

Same as GWmodel::gwpca.cv. If TRUE, robust GWPCA will be applied; otherwise basic GWPCA will be applied

scores

the default="regression" finds factor scores using regression. Alternatives for estimating factor scores include simple regression ("Thurstone"), correlaton preserving ("tenBerge") as well as "Anderson" and "Bartlett" using the appropriate algorithms ( factor.scores). Although scores="tenBerge" is probably preferred for most solutions, it will lead to problems with some improper correlation matrices.

kernel

Same as GWmodel::gwpca.cv. Function chosen as follows: gaussian: wgt = exp(-.5*(vdist/bw)^2); exponential: wgt = exp(-vdist/bw); bisquare: wgt = (1-(vdist/bw)^2)^2 if vdist < bw, wgt=0 otherwise; tricube: wgt = (1-(vdist/bw)^3)^3 if vdist < bw, wgt=0 otherwise; boxcar: wgt=1 if dist < bw, wgt=0 otherwise

adaptive

Same as GWmodel::gwpca.cv. If TRUE calculate an adaptive kernel where the bandwidth (bw) corresponds to the number of nearest neighbours (i.e. adaptive distance); default is FALSE, where a fixed kernel is found (bandwidth is a fixed distance)

p

Same as GWmodel::gwpca. The power of the Minkowski distance, default is 2, i.e. the Euclidean distance.

theta

Same as GWmodel::gwpca. An angle in radians to rotate the coordinate system, default is 0.

longlat

Same as GWmodel::gwpca. If TRUE, great circle distances will be calculated.

dMat

Same as GWmodel::gwpca. A pre-specified distance matrix, it can be calculated by the function gw.dist .

vars

Same as GWmodel::gwpca. The number of retained components; k must be less than the number of variables.

n.obs

Same as psych::fa. Number of observations used to find the correlation matrix if using a correlation matrix. Used for finding the goodness of fit statistics. Must be specified if using a correlaton matrix and finding confidence intervals.

fm

Same as psych::fa. Factoring method fm="minres" will do a minimum residual as will fm="uls". Both of these use a first derivative. fm="ols" differs very slightly from "minres" in that it minimizes the entire residual matrix using an OLS procedure but uses the empirical first derivative. This will be slower. fm="wls" will do a weighted least squares (WLS) solution, fm="gls" does a generalized weighted least squares (GLS), fm="pa" will do the principal factor solution, fm="ml" will do a maximum likelihood factor analysis. fm="minchi" will minimize the sample size weighted chi square when treating pairwise correlations with different number of subjects per pair. fm ="minrank" will do a minimum rank factor analysis. "old.min" will do minimal residual the way it was done prior to April, 2017 (see discussion below). fm="alpha" will do alpha factor analysis as described in Kaiser and Coffey (1965).

rotate

Same as psych::fa. "none", "varimax", "quartimax", "bentlerT", "equamax", "varimin", "geominT" and "bifactor" are orthogonal rotations. "Promax", "promax", "oblimin", "simplimax", "bentlerQ, "geominQ" and "biquartimin" and "cluster" are possible oblique transformations of the solution. The default is to do a oblimin transformation, although versions prior to 2009 defaulted to varimax. SPSS seems to do a Kaiser normalization before doing Promax, this is done here by the call to "promax" which does the normalization before calling Promax in GPArotation.

oblique.scores

When factor scores are found, should they be based on the structure matrix (default) or the pattern matrix (oblique.scores=TRUE). Now it is always false. If you want oblique factor scores, use tenBerge. (See ?psych::fa)

timeout

A numeric specifying the maximum number of seconds the expression is allowed to run before being interrupted by the timeout. (See ?R.utils::wituTimeout)

foreach

default:FALSE. If TRUE, foreach function works to implement calculation using multicores.

Value

Returns the cv of the factor score.

Author(s)

N. Tsutsumida,...

References

Isabella Gollini, Binbin Lu, Martin Charlton, Christopher Brunsdon, Paul Harris (2015). GWmodel: An R Package for Exploring Spatial Heterogeneity Using Geographically Weighted Models. Journal of Statistical Software, 63(17), 1-50. URL http://www.jstatsoft.org/v63/i17/.

Binbin Lu, Paul Harris, Martin Charlton, Christopher Brunsdon (2014). The GWmodel R package: further topics for exploring spatial heterogeneity using geographically weighted models. Geo-spatial Information Science, 17(2), 85-101. URL http://dx.doi.org/10.1080/10095020.2014.917453

Revelle, W. (2017) psych: Procedures for Personality and Psychological Research, Northwestern University, Evanston, Illinois, USA, https://CRAN.R-project.org/package=psych Version = 1.7.8.


naru-T/gwfa documentation built on May 14, 2019, 6:01 a.m.