predict method for mgwrsar model
# S4 method for mgwrsar
predict(
object,
newdata,
newdata_coords,
W = NULL,
type = "BPN",
h_w = 100,
kernel_w = "rectangle",
maxobs = 4000,
beta_proj = FALSE,
method_pred = "TP",
k_extra = 8,
...
)
A vector of predictions if beta_proj is FALSE or a list with a vector named Y_predicted and a matrix named Beta_proj_out.
A vector of predictions.
A model of class mgwrsar-class
.
a matrix or data.frame of new data.
a matrix of new coordinates, and eventually other variables if a General Kernel Product is used.
the spatial weight matrix for models with spatial autocorrelation.
Type for BLUP estimator, default "BPN". If NULL use predictions without spatial bias correction.
A bandwidth value for the spatial weight matrix
kernel type for the spatial weight matrix. Possible types: rectangle ("rectangle"), bisquare ("bisq"), tricube ("tcub"), epanechnikov ("epane"), gaussian ("gauss")) .
maximum number of observations for exact calculation of solve(I- rho*W), default maxobs=4000.
A boolean, if TRUE the function then return a two elements list(Y_predicted,Beta_proj_out)
If method_pred = 'TP' (default) prediction is done by recomputing a MGWRSAR model with new-data as target points, else if method_pred in ('tWtp_model','model','shepard') a matrix for projecting estimated betas is used (see details).
number of neighboors for local parameter extrapolation if shepard kernel is used, default 8.
predict parameters forwarded.
if method_pred ='tWtp_model', the weighting matrix for prediction is based on the expected weights of outsample data if they were had been added to insample data to estimate the corresponding MGWRSAR (see Geniaux 2022 for further detail), if method_pred ='shepard'a shepard kernel with k_extra neighbours (default 8) is used and if method_pred='kernel_model' the same kernel and number of neighbors as for computing the MGWRSAR model is used.