stats (version 3.6.2)

# predict.loess: Predict Loess Curve or Surface

## Description

Predictions from a `loess` fit, optionally with standard errors.

## Usage

```# S3 method for loess
predict(object, newdata = NULL, se = FALSE,
na.action = na.pass, …)```

## Arguments

object

an object fitted by `loess`.

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?

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.

## Value

If `se = FALSE`, a vector giving the prediction for each row of `newdata` (or the original data). If `se = TRUE`, a list containing components

fit

the predicted values.

se

an estimated standard error for each predicted value.

residual.scale

the estimated scale of the residuals used in computing the standard errors.

df

an estimate of the effective degrees of freedom used in estimating the residual scale, intended for use with t-based confidence intervals.

If newdata was the result of a call to expand.grid, the predictions (and s.e.'s if requested) will be an array of the appropriate dimensions.

Predictions from infinite inputs will be NA since loess does not support extrapolation.

## Details

The standard errors calculation is slower than prediction.

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

`loess`

## Examples

Run this code
```# NOT RUN {
cars.lo <- loess(dist ~ speed, cars)
predict(cars.lo, data.frame(speed = seq(5, 30, 1)), se = TRUE)
# to get extrapolation
cars.lo2 <- loess(dist ~ speed, cars,
control = loess.control(surface = "direct"))
predict(cars.lo2, data.frame(speed = seq(5, 30, 1)), se = TRUE)
# }
```

Run the code above in your browser using DataCamp Workspace
{"ft_lang_label":"__label__en","ft_lang_prob":0.5368987,"math_prob":0.9158302,"size":345,"snap":"2022-27-2022-33","text_gpt3_token_len":102,"char_repetition_ratio":0.12316716,"word_repetition_ratio":0.19607843,"special_character_ratio":0.34492755,"punctuation_ratio":0.24324325,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9914073,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-06-30T06:33:36Z\",\"WARC-Record-ID\":\"<urn:uuid:d1a70a1f-281c-465f-a75b-619ebaa324cb>\",\"Content-Length\":\"26477\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:308571af-4b46-40f3-b9b5-74e308582bb7>\",\"WARC-Concurrent-To\":\"<urn:uuid:371493b3-e7ff-4aef-a97f-34cd4616fff4>\",\"WARC-IP-Address\":\"13.249.39.40\",\"WARC-Target-URI\":\"https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/predict.loess\",\"WARC-Payload-Digest\":\"sha1:WYIULBZP2EXWMQRS4AJPIG2IV7FKLGOG\",\"WARC-Block-Digest\":\"sha1:LSYKJSL2GZPPFQOXIQQVRSHLZ35F7JXL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656103669266.42_warc_CC-MAIN-20220630062154-20220630092154-00510.warc.gz\"}"}