EVOLUTION-MANAGER
Edit File: sp.vcov.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Extract smoothing parameter estimator covariance matrix from...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for sp.vcov {mgcv}"><tr><td>sp.vcov {mgcv}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Extract smoothing parameter estimator covariance matrix from (RE)ML GAM fit</h2> <h3>Description</h3> <p> Extracts the estimated covariance matrix for the log smoothing parameter estimates from a (RE)ML estimated <code>gam</code> object, provided the fit was with a method that evaluated the required Hessian. </p> <h3>Usage</h3> <pre> sp.vcov(x,edge.correct=TRUE,reg=1e-3) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> a fitted model object of class <code>gam</code> as produced by <code>gam()</code>.</p> </td></tr> <tr valign="top"><td><code>edge.correct</code></td> <td> <p> if the model was fitted with <code>edge.correct=TRUE</code> (see <code><a href="gam.control.html">gam.control</a></code>), then thereturned covariance matrix will be for the edge corrected log smoothing parameters.</p> </td></tr> <tr valign="top"><td><code>reg</code></td> <td> <p>regularizer for Hessian - default is equivalent to prior variance of 1000 on log smoothing parameters.</p> </td></tr> </table> <h3>Details</h3> <p> Just extracts the inverse of the hessian matrix of the negative (restricted) log likelihood w.r.t the log smoothing parameters, if this has been obtained as part of fitting. </p> <h3>Value</h3> <p> A matrix corresponding to the estimated covariance matrix of the log smoothing parameter estimators, if this can be extracted, otherwise <code>NULL</code>. If the scale parameter has been (RE)ML estimated (i.e. if the method was <code>"ML"</code> or <code>"REML"</code> and the scale parameter was unknown) then the last row and column relate to the log scale parameter. If <code>edge.correct=TRUE</code> and this was used in fitting then the edge corrected smoothing parameters are in attribute <code>lsp</code> of the returned matrix. </p> <h3>Author(s)</h3> <p>Simon N. Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a> </p> <h3>References</h3> <p>Wood, S.N., N. Pya and B. Saefken (2016), Smoothing parameter and model selection for general smooth models (with discussion). Journal of the American Statistical Association 111, 1548-1575 <a href="http://dx.doi.org/10.1080/01621459.2016.1180986">http://dx.doi.org/10.1080/01621459.2016.1180986</a> </p> <h3>See Also</h3> <p><code><a href="gam.html">gam</a></code>, <code><a href="gam.vcomp.html">gam.vcomp</a></code></p> <h3>Examples</h3> <pre> require(mgcv) n <- 100 x <- runif(n);z <- runif(n) y <- sin(x*2*pi) + rnorm(n)*.2 mod <- gam(y~s(x,bs="cc",k=10)+s(z),knots=list(x=seq(0,1,length=10)), method="REML") sp.vcov(mod) </pre> <hr /><div style="text-align: center;">[Package <em>mgcv</em> version 1.8-28 <a href="00Index.html">Index</a>]</div> </body></html>