View source: R/getRadiiSequence.R View source: R/functions.R
getRadiiChoices.vario | R Documentation |
getRadiiChoices.vario()
has been superseded in favour of getRadiiSequence()
getRadiiChoices.vario(
numberofradii = 10,
xydata,
response,
basis,
alpha = 0,
vgmmodel = "Sph",
showplots = FALSE,
distMatrix = NULL,
...
)
numberofradii |
The number of range parameters for SALSA to use when fitting the CReSS smooth. The default is 8. Remember, the more parameters the longer SALSA will take to find a suitable one for each knot location. |
xydata |
Data frame containing columns for x and y coordinates. x is assumed to be the first of the two columns |
response |
vector of response values for use in |
basis |
character stating whether a 'gaussian' or 'exponential' basis is being used. |
alpha |
numeric parameter for the |
showplots |
( |
distMatrix |
Matrix of distances between data locations and knot locations (n x k). May be Euclidean or geodesic distances. Euclidean distances created using |
... |
Other parameters for the |
The range parameter determines the range of the influence of each knot. Small numbers indicate local influence and large ones, global influence.
This function returns a vector containing a sequence of range parameters. If an even number of radii is requested, this is reduced by one to give an odd length sequence where the middle number was the best range parameter from the variogram.
The outputs of the variogram model can be found in the attributes of the returned object under vg.fit
.
# load data
data(ns.data.re)
rad.dat <- dplyr::filter(ns.data.re, impact==0, Year==9, MonthOfYear == 3)
# load knot grid data
data(knotgrid.ns)
# make distance matrices for datatoknots and knottoknots
distMats<-makeDists(cbind(rad.dat$x.pos, rad.dat$y.pos), na.omit(knotgrid.ns))
# choose sequence of radii
r_seq<-getRadiiChoices.vario(8, xydata = rad.dat[,c("x.pos", "y.pos")],
response = log(rad.dat$birds +1 ),
basis = "gaussian",
distMatrix = distMats$dataDist)
r_seq
attr(r_seq, "vg.fit")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.