编程语言R:库方法'loess'中'weights'参数的含义

Programming language R: meaning of 'weights' parameter in library method 'loess'

我使用R编程语言的库方法loess进行非参数数据拟合。数据集是二维的。我没有找到方法参数 weights.

的任何适当文档

我的数据点是正态分布的随机变量,我也有它们各自标准差的估计值。我想知道参数 weights 是否允许我向 R 提供标准差的详细信息。换句话说:我想知道 weights 中的各个权重是否是数据质量的(相对)度量,因此如果通过参数 weights 提供一些数据不确定性度量,则可以改进拟合。

编辑:我怀疑 weights 中的条目用作 LOESS 过程中局部数据集的加权最小二乘回归的权重(可能作为(位置相关的)核函数的附加权重预因子?) .这表明对于独立的正态分布随机变量但仍具有不同噪声水平(即不同的标准偏差)(如我的情况)的数据点,权重应选择为 1/\sigma_{i}^2,其中\sigma_{i} 是各个随机 variable/data 点的标准差。如果有人确切知道,那就太好了。

此页面证实了我的怀疑:

https://docs.tibco.com/pub/enterprise-runtime-for-R/3.1.0/doc/html/Language_Reference/stats/loess.html

关于 loess 的参数 weights 它说:

an optional expression for weights to give to individual observations in the sum of squared residuals that forms the local fitting criterion. By default, an unweighted fit is carried out. If it is supplied, weights is treated as an expression to evaluate in the same data frame as the model formula. It should evaluate to a non-negative numeric vector. If the different observations have nonequal variances, weights should be inversely proportional to the variances.