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

📄 mvr.html

📁 应用程序 偏最小二乘法回归分析 pls matlab
💻 HTML
字号:
<html><head><title>R: Partial Least Squares and Principal Component 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 mvr {pls}"><tr><td>mvr {pls}</td><td align="right">R Documentation</td></tr></table>
<h2>Partial Least Squares and Principal Component Regression</h2>


<h3>Description</h3>

<p>
Functions to perform partial least squares regression (PLSR) or
principal component regression (PCR), with a formula interface.
Cross-validation can be used.  Prediction, model extraction, plot,
print and summary methods exist.
</p>


<h3>Usage</h3>

<pre>
mvr(formula, ncomp, data, subset, na.action,
    method = c("kernelpls", "simpls", "oscorespls", "svdpc", "model.frame"),
    scale = FALSE, validation = c("none", "CV", "LOO"),
    model = TRUE, x = FALSE, y = FALSE, ...)
plsr(..., method = c("kernelpls", "simpls", "oscorespls", "model.frame"))
pcr(..., method = c("svdpc", "model.frame"))
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>formula</code></td>
<td>
a model formula.  Most of the <code>lm</code> formula
constructs are supported.  See below.</td></tr>
<tr valign="top"><td><code>ncomp</code></td>
<td>
the number of components to include in the model (see below).</td></tr>
<tr valign="top"><td><code>data</code></td>
<td>
an optional data frame with the data to fit the model from.</td></tr>
<tr valign="top"><td><code>subset</code></td>
<td>
an optional vector specifying a subset of observations
to be used in the fitting process.</td></tr>
<tr valign="top"><td><code>na.action</code></td>
<td>
a function which indicates what should happen when
the data contain missing values.</td></tr>
<tr valign="top"><td><code>method</code></td>
<td>
the multivariate regression method to be used.  If
<code>"model.frame"</code>, the model frame is returned.</td></tr>
<tr valign="top"><td><code>scale</code></td>
<td>
numeric vector, or logical.  If numeric vector, <i>X</i>
is scaled by dividing each variable with the corresponding element
of <code>scale</code>.  If <code>scale</code> is <code>TRUE</code>, <i>X</i> is scaled
by dividing each variable by its sample standard deviation.  If
cross-validation is selected, scaling by the standard deviation is
done for every segment.</td></tr>
<tr valign="top"><td><code>validation</code></td>
<td>
character.  What kind of (internal) validation to
use.  See below.</td></tr>
<tr valign="top"><td><code>model</code></td>
<td>
a logical.  If <code>TRUE</code>, the model frame is returned.</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
a logical.  If <code>TRUE</code>, the model matrix is returned.</td></tr>
<tr valign="top"><td><code>y</code></td>
<td>
a logical.  If <code>TRUE</code>, the response is returned.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
additional arguments, passed to the underlying fit
functions, and <code>mvrCv</code>.</td></tr>
</table>

<h3>Details</h3>

<p>
The functions fit PLSR or PCR models with 1, <i>...</i>,
<code>ncomp</code> number of components.  Multi-response models are fully
supported.
</p>
<p>
The <code>formula</code> argument should be a symbolic formula of the form
<code>response ~ terms</code>, where <code>response</code> is the name of the
response vector or matrix (for multi-response models) and <code>terms</code>
is the name of one or more predictor matrices, usually separated by
<code>+</code>, e.g., <code>water ~ FTIR</code> or <code>y ~ X + Z</code>.  See
<code><a href="../../stats/html/lm.html">lm</a></code> for a detailed description.  The named
variables should exist in the supplied <code>data</code> data frame or in
the global environment.  Note: Do not use <code>mvr(mydata$y ~
    mydata$X, ...)</code>, instead use <code>mvr(y ~ X, data = mydata,
    ...)</code>.  Otherwise, <code><a href="predict.mvr.html">predict.mvr</a></code> will not work properly.
The chapter <SAMP>Statistical models in R</SAMP> of the manual <SAMP>An
Introduction to R</SAMP> distributed with <font face="Courier New,Courier" color="#666666"><b>R</b></font> is a good reference on
formulas in <font face="Courier New,Courier" color="#666666"><b>R</b></font>.
</p>
<p>
Three PLSR algorithms are available: the kernel algorithm, SIMPLS and
the classical orthogonal scores algorithm.  One PCR algorithm is
available: using the singular value decomposition.  The type of
regression is specified with the <code>method</code> argument.  <code>pcr</code>
and <code>plsr</code>
are wrappers for <code>mvr</code>, with different values for <code>method</code>.
</p>
<p>
If <code>validation = "CV"</code>, cross-validation is performed.  The number and
type of cross-validation segments are specified with the arguments
<code>segments</code> and <code>segment.type</code>.  See <code><a href="mvrCv.html">mvrCv</a></code> for
details.  If <code>validation = "LOO"</code>, leave-one-out cross-validation
is performed.  It is an error to specify the segments when
<code>validation = "LOO"</code> is specified.
</p>
<p>
Note that the cross-validation is optimised for speed, and some
generality has been sacrificed.  Especially, the model matrix is
calculated only once for the complete cross-validation, so models like
<code>y ~ msc(X)</code> will not be properly cross-validated.  However,
scaling requested by <code>scale = TRUE</code> is properly cross-validated.
For proper cross-validation of models where the model matrix must be
updated/regenerated for each segment, use the separate function
<code><a href="crossval.html">crossval</a></code>.
</p>


<h3>Value</h3>

<p>
If <code>method = "model.frame"</code>, the model frame is returned.
Otherwise, an object of class <code>mvr</code> is returned.
The object contains all components returned by the underlying fit
function.  In addition, it contains the following components:
</p>
<table summary="R argblock">
<tr valign="top"><td><code>validation</code></td>
<td>
if validation was requested, the results of the
cross-validation.  See <code><a href="mvrCv.html">mvrCv</a></code> for details.</td></tr>
<tr valign="top"><td><code>ncomp</code></td>
<td>
the number of components of the model.</td></tr>
<tr valign="top"><td><code>method</code></td>
<td>
the method used to fit the model.  See the argument
<code>method</code> for possible values.</td></tr>
<tr valign="top"><td><code>scale</code></td>
<td>
if scaling was requested (with <code>scale</code>), the
scaling used.</td></tr>
<tr valign="top"><td><code>call</code></td>
<td>
the function call.</td></tr>
<tr valign="top"><td><code>terms</code></td>
<td>
the model terms.</td></tr>
<tr valign="top"><td><code>model</code></td>
<td>
if <code>model = TRUE</code>, the model frame.</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
if <code>x = TRUE</code>, the model matrix.</td></tr>
<tr valign="top"><td><code>y</code></td>
<td>
if <code>y = TRUE</code>, the model response.</td></tr>
</table>

<h3>Author(s)</h3>

<p>
Ron Wehrens and Bj鴕n-Helge Mevik
</p>


<h3>References</h3>

<p>
Martens, H., N鎠, T. (1989) <EM>Multivariate calibration.</EM>
Chichester: Wiley.
</p>


<h3>See Also</h3>

<p>
<code><a href="kernelpls.fit.html">kernelpls.fit</a></code>,
<code><a href="simpls.fit.html">simpls.fit</a></code>,
<code><a href="oscorespls.fit.html">oscorespls.fit</a></code>,
<code><a href="svdpc.fit.html">svdpc.fit</a></code>,
<code><a href="mvrCv.html">mvrCv</a></code>,
<code><a href="crossval.html">crossval</a></code>,
<code><a href="../../stats/html/loadings.html">loadings</a></code>,
<code><a href="scores.html">scores</a></code>,
<code><a href="scores.html">loading.weights</a></code>,
<code><a href="coef.mvr.html">coef.mvr</a></code>,
<code><a href="predict.mvr.html">predict.mvr</a></code>,
<code><a href="MSEP.html">R2</a></code>,
<code><a href="MSEP.html">MSEP</a></code>,
<code><a href="MSEP.html">RMSEP</a></code>,
<code><a href="plot.mvr.html">plot.mvr</a></code>
</p>


<h3>Examples</h3>

<pre>
data(NIR)
## Default methods:
NIR.pcr &lt;- pcr(y ~ X, 6, data = NIR, validation = "CV")
NIR.pls &lt;- plsr(y ~ X, 6, data = NIR, validation = "CV")

## Alternative methods:
NIR.oscorespls &lt;- mvr(y ~ X, 6, data = NIR, validation = "CV",
                      method = "oscorespls")
NIR.simpls &lt;- mvr(y ~ X, 6, data = NIR, validation = "CV",
                  method = "simpls")

data(sensory)
Pn &lt;- scale(sensory$Panel)
Ql &lt;- scale(sensory$Quality)
sens.pcr &lt;- pcr(Ql ~ Pn, ncomp = 4)
sens.pls &lt;- plsr(Ql ~ Pn, ncomp = 4)
</pre>



<hr><div align="center">[Package <em>pls</em> version 1.1-0 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

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