predloess: Spatially Local Polynomial Regression Prediction

Description Usage Arguments Details Author(s) Examples

Description

The first layer of the prediction of Spatial locally weighted regression. Mainly used as prediction function for the NAs in the original data set.

Usage

1
predloess(object, newdata = NULL, se = FALSE, na.action = na.pass, ...)

Arguments

object

an object fitted by 'spaloess'.

newdata

an optional data frame in which to look for variables with which to predict, or a matrix or vector containing exactly the variables needs for prediction. If missing, the original data points are used.

se

should standard errors be computed? Default is FALSE

na.action

function determining what should be done with missing values in data frame 'newdata'. The default is to predict 'NA'.

...

arguments passed to or from other methods.

Details

This is the first layer of prediction function of spatial locally weigted regression. In the spaloess function, NA will be removed from the fitting. By passing the spaloess object and NA observations to predloess, predction at the locations of NA is carried out.

When the fit was made using 'surface = "interpolate"' (the default), 'predloess' will not extrapolate - so points outside an axis-aligned hypercube enclosing the original data will have missing ('NA') predictions and standard errors.

Author(s)

Xiaosu Tong, based on 'loess' function of B. D. Ripley, and 'cloess' package of Cleveland, Grosse and Shyu.

Examples

1
2
3
4
5
6
    set.seed(66)
    x1 <- rnorm(100, mean=-100, sd=10)
    x2 <- rnorm(100, mean=38, sd=4)
    y <- 0.1*x1 + 1*x2 - 10 + rnorm(100, 0, 1.3); y[1:2] <- NA
    testdata <- data.frame(LON = x1, LAT = x2, tmax = y)
    cars.lo <- spaloess(tmax ~ LON + LAT, testdata, distance = "Latlong")

XiaosuTong/Spaloess documentation built on May 9, 2019, 11:06 p.m.