⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lm.ridge.html

📁 本程序是基于linux系统下c++代码
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Ridge Regression</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for lm.ridge {MASS}"><tr><td>lm.ridge {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Ridge Regression</h2>


<h3>Description</h3>

<p>
Fit a linear model by ridge regression.
</p>


<h3>Usage</h3>

<pre>
lm.ridge(formula, data, subset, na.action, lambda = 0, model = FALSE,
         x = FALSE, y = FALSE, contrasts = NULL, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>formula</code></td>
<td>
a formula expression as for regression models, of the form
<code>response ~ predictors</code>. See the documentation of <code>formula</code>
for other details. <code><a href="../../stats/html/offset.html">offset</a></code> terms are allowed.
</td></tr>
<tr valign="top"><td><code>data</code></td>
<td>
an optional data frame in which to interpret the variables occurring
in <code>formula</code>.
</td></tr>
<tr valign="top"><td><code>subset</code></td>
<td>
expression saying which subset of the rows of the data should  be used
in the fit.  All observations are included by default.
</td></tr>
<tr valign="top"><td><code>na.action</code></td>
<td>
a function to filter missing data.
</td></tr>
<tr valign="top"><td><code>lambda</code></td>
<td>
A scalar or vector of ridge constants.
</td></tr>
<tr valign="top"><td><code>model</code></td>
<td>
should the model frame be returned?
</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
should the design matrix be returned?
</td></tr>
<tr valign="top"><td><code>y</code></td>
<td>
should the response be returned?
</td></tr>
<tr valign="top"><td><code>contrasts</code></td>
<td>
a list of contrasts to be used for some or all of factor terms in the
formula. See the <code>contrasts.arg</code> of <code><a href="../../stats/html/model.matrix.html">model.matrix.default</a></code>.
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
additional arguments to <code><a href="../../stats/html/lmfit.html">lm.fit</a></code>.
</td></tr>
</table>

<h3>Details</h3>

<p>
If an intercept is present in the model, its coefficient is not
penalized.  (If you want to penalized an intercept, put in your own
constant term and remove the intercept.)
</p>


<h3>Value</h3>

<p>
A list with components
</p>
<table summary="R argblock">
<tr valign="top"><td><code>coef</code></td>
<td>
matrix of coefficients, one row for each value of <code>lambda</code>.
Note that these are not on the original scale and are for use by the
<code><a href="../../vars/html/coefficients.html">coef</a></code> method.
</td></tr>
<tr valign="top"><td><code>scales</code></td>
<td>
scalings used on the X matrix.
</td></tr>
<tr valign="top"><td><code>Inter</code></td>
<td>
was intercept included?
</td></tr>
<tr valign="top"><td><code>lambda</code></td>
<td>
vector of lambda values
</td></tr>
<tr valign="top"><td><code>ym</code></td>
<td>
mean of <code>y</code>
</td></tr>
<tr valign="top"><td><code>xm</code></td>
<td>
column means of <code>x</code> matrix
</td></tr>
<tr valign="top"><td><code>GCV</code></td>
<td>
vector of GCV values
</td></tr>
<tr valign="top"><td><code>kHKB</code></td>
<td>
HKB estimate of the ridge constant.
</td></tr>
<tr valign="top"><td><code>kLW</code></td>
<td>
L-W estimate of the ridge constant.
</td></tr>
</table>

<h3>References</h3>

<p>
Brown, P. J. (1994)
<EM>Measurement, Regression and Calibration</EM>
Oxford.
</p>


<h3>See Also</h3>

<p>
<code><a href="../../VGAM/html/notdocumentedyet.html">lm</a></code>
</p>


<h3>Examples</h3>

<pre>
data(longley) # not the same as the S-PLUS dataset
names(longley)[1] &lt;- "y"
lm.ridge(y ~ ., longley)
plot(lm.ridge(y ~ ., longley,
              lambda = seq(0,0.1,0.001)))
select(lm.ridge(y ~ ., longley,
               lambda = seq(0,0.1,0.0001)))
</pre>



<hr><div align="center">[Package <em>MASS</em> version 7.2-44 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -