EVOLUTION-MANAGER
Edit File: fs.test.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: FELSPLINE test function</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 fs.test {mgcv}"><tr><td>fs.test {mgcv}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>FELSPLINE test function</h2> <h3>Description</h3> <p>Implements a finite area test function based on one proposed by Tim Ramsay (2002). </p> <h3>Usage</h3> <pre> fs.test(x,y,r0=.1,r=.5,l=3,b=1,exclude=TRUE) fs.boundary(r0=.1,r=.5,l=3,n.theta=20) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x,y</code></td> <td> <p>Points at which to evaluate the test function.</p> </td></tr> <tr valign="top"><td><code>r0</code></td> <td> <p>The test domain is a sort of bent sausage. This is the radius of the inner bend</p> </td></tr> <tr valign="top"><td><code>r</code></td> <td> <p>The radius of the curve at the centre of the sausage.</p> </td></tr> <tr valign="top"><td><code>l</code></td> <td> <p>The length of an arm of the sausage.</p> </td></tr> <tr valign="top"><td><code>b</code></td> <td> <p>The rate at which the function increases per unit increase in distance along the centre line of the sausage.</p> </td></tr> <tr valign="top"><td><code>exclude</code></td> <td> <p>Should exterior points be set to <code>NA</code>?</p> </td></tr> <tr valign="top"><td><code>n.theta</code></td> <td> <p>How many points to use in a piecewise linear representation of a quarter of a circle, when generating the boundary curve.</p> </td></tr> </table> <h3>Details</h3> <p>The function details are not given in the source article: but this is pretty close. The function is modified from Ramsay (2002), in that it bulges, rather than being flat: this makes a better test of the smoother. </p> <h3>Value</h3> <p><code>fs.test</code> returns function evaluations, or <code>NA</code>s for points outside the boundary. <code>fs.boundary</code> returns a list of <code>x,y</code> points to be jointed up in order to define/draw the boundary. </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>Tim Ramsay (2002) "Spline smoothing over difficult regions" J.R.Statist. Soc. B 64(2):307-319 </p> <h3>Examples</h3> <pre> require(mgcv) ## plot the function, and its boundary... fsb <- fs.boundary() m<-300;n<-150 xm <- seq(-1,4,length=m);yn<-seq(-1,1,length=n) xx <- rep(xm,n);yy<-rep(yn,rep(m,n)) tru <- matrix(fs.test(xx,yy),m,n) ## truth image(xm,yn,tru,col=heat.colors(100),xlab="x",ylab="y") lines(fsb$x,fsb$y,lwd=3) contour(xm,yn,tru,levels=seq(-5,5,by=.25),add=TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>mgcv</em> version 1.8-28 <a href="00Index.html">Index</a>]</div> </body></html>