Commit d4264120 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 1.3-9

parent ac2cefa6
Package: mgcv
Version: 1.3-8
Version: 1.3-9
Author: Simon Wood <simon.wood@r-project.org>
Maintainer: Simon Wood <simon.wood@r-project.org>
Title: GAMs with GCV smoothness estimation and GAMMs by REML/PQL
......@@ -12,4 +12,4 @@ Imports: graphics, stats
Suggests: nlme (>= 3.1-64), MASS (>= 7.2-2)
LazyLoad: yes
License: GPL version 2 or later
Packaged: Fri Oct 14 22:15:51 2005; simon
Packaged: Wed Nov 9 20:40:38 2005; simon
1.3-9
* constants multiplying TPRS basis functions were `unconventional' for d
odd in function eta() in tprs.c. The constants are immaterial if you are
using gam, gamm etc, but matter if you are trying to get out the
explicit representation of a TPRS term yourself (e.g. to differentiate
a smooth exactly).
1.3-8
* get.var() now checks that result is numeric or factor (avoids
......
......@@ -33,12 +33,13 @@ double eta(int m,int d,double r)
wiggliness penalty. */
{ static int first=1;
static double pi,Ghalf;
static double pi,rpi,Ghalf;
double f;
int i,k;
if (first)
{ first=0;
pi=asin(1.0)*2.0;
rpi=sqrt(pi);
Ghalf=sqrt(pi); /* Gamma function of 0.5 */
}
if (2*m<=d) ErrorMessage(_("You must have 2m>d for a thin plate spline."),1);
......@@ -54,9 +55,9 @@ double eta(int m,int d,double r)
} else /* d odd */
{ f=Ghalf;
k=m-(d-1)/2; /* 1/2 - d = d/2 -m */
for (i=0;i<k;i++) f/= -0.5-k; /* f = gamma function of d/2-m */
for (i=0;i<k;i++) f/= -0.5-i; /* f = gamma function of d/2-m */
for (i=0;i<m;i++) f/= 4; /* divide by 2^{2m} */
for (i=0;i<d/2;i++) f/=pi;
for (i=0;i<d-1;i++) f/=pi;
f /= Ghalf; /* dividing by (pi^{d/2}) */
for (i=2;i<m;i++) f/=i; /* divide by (m-1)! */
for (i=0;i<2*m-d;i++) f*=r;
......@@ -484,6 +485,7 @@ void tprs_setup(double **x,double **knt,int m,int d,int n,int k,int constant,mat
it doesn't write all sorts of things to un-allocated memory. Many thanks to Luke
Tierney for finding this.
3/10/2002 - tprs_setup now tells tps_g() to clear up before returning
1/11/2005 - eta() constants `wrong' for odd d: fixed.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment