找回密码
 注册
查看: 1475|回复: 0

R语言 aroma.light包 likelihood.smooth.spline()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 12:05:18 | 显示全部楼层 |阅读模式
likelihood.smooth.spline(aroma.light)
likelihood.smooth.spline()所属R语言包:aroma.light

                                        Calculate the log likelihood of a smoothing spline given the data
                                         平滑样条提供的数据计算对数似然

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Calculate the (log) likelihood of a spline given the data used to fit the spline, g. The likelihood consists of two main parts: 1) (weighted) residuals sum of squares, and 2) a penalty term. The penalty term consists of a smoothing parameter lambda and a roughness measure of the spline J(g) = \int g''(t) dt. Hence, the overall log likelihood is
计算使用的数据,以适应样条样条,g(log)的可能性。由两个主要部分:1)(加权)残差平方和,2)刑罚术语的可能性。刑罚的任期由平滑参数lambda和粗糙度测量的样条J(g) = \int g''(t) dt。因此,整体log的可能性

In addition to the overall likelihood, all its seperate components are also returned.
除了整体的可能性,其所有的单独组件也回来了。

Note: when fitting a smooth spline with (x,y) values where the x's are not unique, smooth.spline will replace such (x,y)'s with a new pair (x,y') where y' is a reweighted average on the original y's. It is important to be aware of this. In such cases, the resulting smooth.spline object does not contain all (x,y)'s and therefore this function will not calculate the weighted residuals sum of square on the original data set, but on the data set with unique x's. See examples below how to calculate the likelihood for the spline with the original data.
注:装修时(x,y)值x的不是唯一的,smooth.spline将取代如(x,y)一双新的(x,y')小号的光滑样条y'是对原y的重加权平均。重要的是要认识到这一点。在这种情况下,由此产生的smooth.spline对象并不包含所有(x,y)的,因此这个功能不会对原始数据集计算的加权残差平方和,但对数据设置独特的 x的。看到下面如何计算与原始数据的样条线的可能性的例子。


用法----------Usage----------





参数----------Arguments----------

参数:object
The smooth.spline object.
smooth.spline对象。


参数:x, y
The x and y values for which the (weighted) likelihood will be calculated. If x is of type xy.coords any value of argument y will be omitted. If x==NULL, the x and y values of the smoothing spline will be used.
(加权)的可能性将被计算在X和Y值。 x如果类型xy.coords参数y的任何值将被忽略。如果x==NULL,平滑样条的X和Y值将用于。


参数:w
The weights for which the (weighted) likelihood will be calculated. If NULL, weights equal to one are assumed.
将计算出的权重(加权)的可能性。如果NULL,重量等于一体的假设。


参数:base
The base of the logarithm of the likelihood. If NULL, the non-logged likelihood is returned.
可能性的对数的基础。如果NULL,返回非记录的可能性。


参数:rel.tol
The relative tolerance used in the call to integrate.
调用integrate在相对宽容的。


参数:...
Not used.
不使用。


Details

详情----------Details----------

The roughness penalty for the smoothing spline, g, fitted from data in the interval [a,b] is defined as
粗糙度的平滑样条罚款,g,从安装的间隔[a,b]中的数据被定义为

which is the same as
这是一样的

The latter is calculated internally by using predict.smooth.spline.
后者是内部计算使用predict.smooth.spline。


值----------Value----------

Returns the overall (log) likelihood of class SmoothSplineLikelihood, a class with the following attributes:
返回的整体(log)类的可能性SmoothSplineLikelihood,一类具有以下属性:


参数:wrss
the (weighted) residual sum of square
(加权)剩余平方和


参数:penalty
the penalty which is equal to -lambda*roughness.
罚款是等于-lambda*roughness。


参数:lambda
the smoothing parameter
平滑参数


参数:roughness
the value of the roughness functional given the specific smoothing spline and the range of data
的粗糙度功能给予具体的光滑样条和数据的范围值


作者(S)----------Author(s)----------


Henrik Bengtsson (<a href="http://www.braju.com/R/">http://www.braju.com/R/</a>)



参见----------See Also----------

smooth.spline and robustSmoothSpline().
smooth.spline和robustSmoothSpline()。


举例----------Examples----------


# Define f(x)[定义F(X)]
f <- expression(0.1*x^4 + 1*x^3 + 2*x^2 + x + 10*sin(2*x))

# Simulate data from this function in the range [a,b][从这个范围内的功能模拟数据[A,B]]
a <- -2; b <- 5
x <- seq(a, b, length=3000)
y <- eval(f)

# Add some noise to the data[添加一些噪音数据]
y <- y + rnorm(length(y), 0, 10)

# Plot the function and its second derivative[绘制的功能和它的第二个衍生]
plot(x,y, type="l", lwd=4)

# Fit a cubic smoothing spline and plot it[适合三次样条和绘制]
g <- smooth.spline(x,y, df=16)
lines(g, col="yellow", lwd=2, lty=2)

# Calculating the (log) likelihood of the fitted spline[计算拟合样条(log)的可能性]
l <- likelihood(g)

cat("Log likelihood with unique x values:\n")
print(l)

# Note that this is not the same as the log likelihood of the[请注意,这是不作为log的可能性相同]
# data on the fitted spline iff the x values are non-unique[数据拟合样条曲线,当且仅当x值非唯一]
x[1:5] &lt;- x[1]  # Non-unique x values[非唯一的x值]
g <- smooth.spline(x,y, df=16)
l <- likelihood(g)

cat("\nLog likelihood of the *spline* data set:\n");
print(l)

# In cases with non unique x values one has to proceed as[在与非独特的X值的情况下继续为]
# below if one want to get the log likelihood for the original[下面,如果一个人想获得的原始log的可能性]
# data.[数据。]
l <- likelihood(g, x=x, y=y)
cat("\nLog likelihood of the *original* data set:\n");
print(l)






转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 01:37 , Processed in 0.019034 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表