loess(stats)
loess()所属R语言包:stats
Local Polynomial Regression Fitting
局部多项式回归拟合
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Fit a polynomial surface determined by one or more numerical predictors, using local fitting.
由一个或多个数值预测,采用局部装修,确定适合多项式曲面。
用法----------Usage----------
loess(formula, data, weights, subset, na.action, model = FALSE,
span = 0.75, enp.target, degree = 2,
parametric = FALSE, drop.square = FALSE, normalize = TRUE,
family = c("gaussian", "symmetric"),
method = c("loess", "model.frame"),
control = loess.control(...), ...)
参数----------Arguments----------
参数:formula
a formula specifying the numeric response and one to four numeric predictors (best specified via an interaction, but can also be specified additively). Will be coerced to a formula if necessary.
公式指定数字的响应和一至四个数字的预测(最好指定通过一个互动,但也可以指定相加)。将强制如果有必要的公式。
参数:data
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which loess is called.
一个可选的数据框,列表或环境(as.data.frame到一个数据框或对象强制转换)包含在模型中的变量。如果没有找到data,environment(formula),通常是从哪个loess被称为环境变量。
参数:weights
optional weights for each case.
每情况件的可选重量。
参数:subset
an optional specification of a subset of the data to be used.
要使用的数据的一个子集的可选规格。
参数:na.action
the action to be taken with missing values in the response or predictors. The default is given by getOption("na.action").
遗漏值在响应或预测的要采取的行动。默认getOption("na.action")。
参数:model
should the model frame be returned?
模型框架应退还?
参数:span
the parameter α which controls the degree of smoothing.
参数α控制的平滑度。
参数:enp.target
an alternative way to specify span, as the approximate equivalent number of parameters to be used.
另一种方式来指定span,作为近似同等数量的参数,可用于。
参数:degree
the degree of the polynomials to be used, normally 1 or 2. (Degree 0 is also allowed, but see the "Note".)
要使用,通常为1或2度的多项式。 (度0也被允许,但看到“注意”。)
参数:parametric
should any terms be fitted globally rather than locally? Terms can be specified by name, number or as a logical vector of the same length as the number of predictors.
任何条款应装有全球而非本地?条款可以指定名称,数量或作为逻辑向量相同长度的预测数。
参数:drop.square
for fits with more than one predictor and degree=2, should the quadratic term be dropped for particular predictors? Terms are specified in the same way as for parametric.
与多个预测和degree=2一刀切,应该被丢弃的二次项为特定的预测吗?条款规定在以同样的方式作为parametric。
参数:normalize
should the predictors be normalized to a common scale if there is more than one? The normalization used is to set the 10% trimmed standard deviation to one. Set to false for spatial coordinate predictors and others know to be a common scale.
的预测应该被归到一个共同的规模,如果有一个以上的?使用正常化是设置的10%削减一个标准偏差。设置为false,为空间坐标的预测和其他人知道的是一个共同的规模。
参数:family
if "gaussian" fitting is by least-squares, and if "symmetric" a re-descending M estimator is used with Tukey's biweight function.
如果"gaussian"拟合最小二乘,如果"symmetric"降序重新-M估计使用Tukey的biweight功能。
参数:method
fit the model or just extract the model frame.
适合的模型,或只提取模型框架。
参数:control
control parameters: see loess.control.
控制参数:看到loess.control。
参数:...
control parameters can also be supplied directly.
控制参数,也可以直接提供。
Details
详情----------Details----------
Fitting is done locally. That is, for the fit at point x, the fit is made using points in a neighbourhood of x, weighted by their distance from x (with differences in "parametric" variables being ignored when computing the distance). The size of the neighbourhood is controlled by α (set by span or enp.target). For α < 1, the neighbourhood includes proportion α of the points, and these have tricubic weighting (proportional to (1 - (dist/maxdist)^3)^3). For α > 1, all points are used, with the "maximum distance" assumed to be α^1/p times the actual maximum distance for p explanatory variables.
拟合是在本地完成。也就是说,适合在点x,x(参数变量的差异距离加权x,适合使用在附近点计算距离时忽略)。附近的大小控制由α(span或enp.target设置)。 “α < 1,邻里比例α点,而这些有tricubic比重(成正比(1 - (dist/maxdist)^3)^3)。 α > 1,所有点都用“最大距离”,认为是α^1/p倍p解释变量的实际最大传输距离。
For the default family, fitting is by (weighted) least squares. For family="symmetric" a few iterations of an M-estimation procedure with Tukey's biweight are used. Be aware that as the initial value is the least-squares fit, this need not be a very resistant fit.
对于默认的家庭,装修(加权)最小二乘。 family="symmetric"M-估计的程序与Tukey的biweight几个迭代使用。要知道作为初始值最小二乘适合,这不一定是一个非常耐合适。
It can be important to tune the control list to achieve acceptable speed. See loess.control for details.
它可以是重要的调整控制列表来实现可接受的速度。看到loess.control详情。
值----------Value----------
An object of class "loess".
对象类"loess"。
注意----------Note----------
As this is based on cloess, it is similar to but not identical to the loess function of S. In particular, conditioning is not implemented.
由于这是基于cloess,它是类似但不完全相同的loessS的功能特别是,空调没有实现。
The memory usage of this implementation of loess is roughly quadratic in the number of points, with 1000 points taking about 10Mb.
执行这个loess内存使用点的数量大约是二次,大约10MB到1000点。
degree = 0, local constant fitting, is allowed in this implementation but not documented in the reference. It seems very little tested, so use with caution.
degree = 0,本地固定接头,允许在此实现,但没有在参考文件。它似乎很少的测试,所以请谨慎使用。
作者(S)----------Author(s)----------
B. D. Ripley, based on the <code>cloess</code> package of Cleveland,
Grosse and Shyu (currently available as <code>dloess</code> at
<a href="http://www.netlib.org/a">http://www.netlib.org/a</a>: the <font face="Courier New,Courier" color="#666666"><b>R</b></font> implementation is based on an
1998 version).
参考文献----------References----------
models. Chapter 8 of Statistical Models in S eds J.M. Chambers and T.J. Hastie, Wadsworth & Brooks/Cole.
参见----------See Also----------
loess.control, predict.loess.
loess.control,predict.loess。
lowess, the ancestor of loess (with different defaults!).
lowess,loess(用不同的默认值!)的祖先。
举例----------Examples----------
cars.lo <- loess(dist ~ speed, cars)
predict(cars.lo, data.frame(speed = seq(5, 30, 1)), se = TRUE)
# to allow extrapolation[允许外推]
cars.lo2 <- loess(dist ~ speed, cars,
control = loess.control(surface = "direct"))
predict(cars.lo2, data.frame(speed = seq(5, 30, 1)), se = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|