📄 msep.html
字号:
<html><head><title>R: MSEP, RMSEP and R2 of PLSR and PCR models</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 MSEP {pls}"><tr><td>MSEP {pls}</td><td align="right">R Documentation</td></tr></table>
<h2>MSEP, RMSEP and R2 of PLSR and PCR models</h2>
<h3>Description</h3>
<p>
Functions to estimate the mean squared error of prediction (MSEP),
root mean squared error of prediction (RMSEP) and <i>R^2</i> for fitted
PCR and PLSR models. Test-set, cross-validation and calibration-set
estimates are implemented.
</p>
<h3>Usage</h3>
<pre>
MSEP(object, estimate, newdata, comps = 1:object$ncomp,
cumulative = TRUE, intercept = cumulative, se = FALSE, ...)
RMSEP(...)
R2(object, estimate, newdata, comps = 1:object$ncomp,
cumulative = TRUE, intercept = cumulative, se = FALSE, ...)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>object</code></td>
<td>
an <code>mvr</code> object</td></tr>
<tr valign="top"><td><code>estimate</code></td>
<td>
a character vector. Which estimators to use.
Should be a subset of <code>c("all", "train", "CV", "adjCV",
"test")</code>. <code>"adjCV"</code> is only available for (R)MSEP. See
below for how the estimators are chosen.</td></tr>
<tr valign="top"><td><code>newdata</code></td>
<td>
a data frame with test set data.</td></tr>
<tr valign="top"><td><code>comps</code></td>
<td>
a vector of positive integers. The components or number
of components to use. See below.</td></tr>
<tr valign="top"><td><code>cumulative</code></td>
<td>
logical. See below.</td></tr>
<tr valign="top"><td><code>intercept</code></td>
<td>
logical. Whether estimates for a model with zero
components should be returned as well.</td></tr>
<tr valign="top"><td><code>se</code></td>
<td>
logical. Whether estimated standard errors of the estimates
should be calculated. Not implemented yet.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
further arguments sent to underlying functions or (for
<code>RMSEP</code>) to <code>MSEP</code></td></tr>
</table>
<h3>Details</h3>
<p>
<code>RMSEP</code> simply calls <code>MSEP</code> and takes the square root of the
estimates. It therefore accepts the same arguments as <code>MSEP</code>.
</p>
<p>
Several estimators can be used. <code>"train"</code> is the training
or calibration data estimate, also called (R)MSEC. For <code>R2</code>,
this is the unadjusted <i>R^2</i>. It is
overoptimistic and should not be used for assessing models.
<code>"CV"</code> is the cross-validation estimate, and <code>"adjCV"</code> (for
<code>RMSEP</code> and <code>MSEP</code>) is
the bias-corrected cross-validation estimate. They can only be
calculated if the model has been cross-validated.
Finally, <code>"test"</code> is the test set estimate, using <code>newdata</code>
as test set.
</p>
<p>
Which estimators to use is decided as follows. If
<code>estimate</code> is not specified, the test set estimate is returned if
<code>newdata</code> is specified, otherwise the CV and adjusted CV (for
<code>RMSEP</code> and <code>MSEP</code>)
estimates if the model has been cross-validated, otherwise the
training data estimate. If <code>estimate</code> is <code>"all"</code>, all
possible estimates are calculated. Otherwise, the specified estimates
are calculated.
</p>
<p>
Several model sizes can also be specified. If <code>cumulative</code> is
<code>TRUE</code> (default), <code>length(comps)</code> models are used, with
<code>comps[1]</code> components, ..., <code>comps[length(comps)]</code>
components. Otherwise, a single model with the components
<code>comps[1]</code>, ..., <code>comps[length(comps)]</code> is used.
</p>
<p>
If <code>intercept</code> is <code>TRUE</code>, a model with zero components is
also used (in addition to the above). For <code>R2</code>, this is simply
defined as 0.
</p>
<h3>Value</h3>
<p>
An object of class <code>"mvrVal"</code>, with components
</p>
<table summary="R argblock">
<tr valign="top"><td><code>val</code></td>
<td>
three-dimensional array of estimates. The first dimension
is the different estimators, the second is the response variables
and the third is the models.</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
<code>"MSEP"</code>, <code>"RMSEP"</code> or <code>"R2"</code>.</td></tr>
<tr valign="top"><td><code>comps</code></td>
<td>
the components specified, with <code>0</code> prepended if
<code>intercept</code> is <code>TRUE</code>.</td></tr>
<tr valign="top"><td><code>call</code></td>
<td>
the function call</td></tr>
</table>
<h3>Author(s)</h3>
<p>
Ron Wehrens and Bj鴕n-Helge Mevik
</p>
<h3>References</h3>
<p>
Mevik, B.-H., Cederkvist, H. R. (2004) Mean Squared Error of
Prediction (MSEP) Estimates for Principal Component Regression (PCR)
and Partial Least Squares Regression (PLSR).
<EM>Journal of Chemometrics</EM>, <B>18</B>(9), 422–429.
</p>
<h3>See Also</h3>
<p>
<code><a href="mvr.html">mvr</a></code>, <code><a href="crossval.html">crossval</a></code>, <code><a href="mvrCv.html">mvrCv</a></code>,
<code><a href="validationplot.html">validationplot</a></code>, <code><a href="validationplot.html">plot.mvrVal</a></code>
</p>
<h3>Examples</h3>
<pre>
data(sensory)
mod <- plsr(Panel ~ Quality, ncomp = 4, data = sensory, validation = "LOO")
RMSEP(mod)
## Not run: plot(R2(mod))
</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 + -