Commit d6910893 authored by Andreas Tille's avatar Andreas Tille

New upstream version 2.1.13

parent 36745746
Package: logspline
Version: 2.1.11
Date: 2018-06-14
Version: 2.1.13
Date: 2019-06-13
Title: Routines for Logspline Density Estimation
Author: Charles Kooperberg <clk@fredhutch.org>
Maintainer: Charles Kooperberg <clk@fredhutch.org>
Description: Contains routines for logspline density estimation.
The function oldlogspline() uses the same algorithm as the logspline package
version 1.0.x; i.e. the Kooperberg and Stone (1992) <DOI:10.2307/1390786>
version 1.0.x; i.e. the Kooperberg and Stone (1992)
algorithm (with an improved interface). The recommended routine logspline()
uses an algorithm from Stone et al (1997) <DOI:10.1214/aos/1031594728>.
Imports: stats, graphics
License: Apache License 2.0
NeedsCompilation: yes
Packaged: 2018-06-14 19:11:08 UTC; clk
Packaged: 2019-06-13 18:13:45 UTC; clk
Repository: CRAN
Date/Publication: 2018-06-14 19:44:30 UTC
Date/Publication: 2019-06-13 22:30:04 UTC
f95c841aa7f92a244b373c69aca3a2dd *DESCRIPTION
cf1a546b134c2552176b43be0b32ed95 *DESCRIPTION
73d98ba76a12b8b7aed3bb0ac4d6183c *NAMESPACE
cfc92ccd57493b57ad1714288d9daeb1 *R/logspline.R
8ba7e6e72a0775874f0ada5446549a40 *R/logspline.R
e5937390332be13e210110b2f5030d8d *man/dlogspline.Rd
1905f0e1bc2347092ee3a4d6fc806b08 *man/doldlogspline.Rd
0523706ecb792f50782788cb50fea636 *man/logspline-internal.Rd
......@@ -14,7 +14,7 @@ eabaae5f996c1402466f5a54717a3121 *man/summary.logspline.Rd
d9d2d511c4cec309ecc1c2f05d87b121 *man/unstrip.Rd
8290d2e9740414e315237f0d5d4024bb *src/Makevars
157084291a6fa50c11e5d7ae2325507f *src/allpack.f
3975f51f6ed3550a08dc0aee0196cdec *src/lsdall.c
cd4f299bb18985e5154ec39e27d29cc2 *src/nlsd.c
c625d1f0667c03581e95c09fdf044aae *src/registerDynamicSymbol.c
b4c5ece2af7d27242dfe3583d1f02cc4 *src/lsdall.c
3ed6a299c32fcb7b91b74e582694b6db *src/nlsd.c
8197458ba2a4b07354e1cc3561a908fd *src/registerDynamicSymbol.c
782c6ba6b56e9842d5854775ce3653e3 *src/x2c.h
......@@ -48,61 +48,25 @@ oldlogspline.to.logspline <- function(obj,data)
nobj$logl <- obj$logl[obj$logl!=0]
lx <- length(nobj$logl)
nobj$logl <- cbind(nobj$maxknots+1-(lx:1),c(rep(2,lx-1),1),nobj$logl)
class(nobj) <- "logspline"
if(!missing(data))nobj$range <- obj$range
else {
lx <- 1/(nobj$samples+1)
nobj$range <- qoldlogspline(c(lx,1-lx),obj)
nobj$range <- qlogspline(c(lx,1-lx),nobj)
}
nobj$mind
class(nobj) <- "logspline"
nobj
}
poldlogspline <- function(q, fit)
{
if(class(fit)!="oldlogspline")
stop("fit is not an oldlogspline object")
q <- unstrip(q)
sq <- rank(q)
q <- sort(q)
z <- .C("pqlsd",
as.double(fit$coef),
as.double(fit$knots),
as.double(fit$bound),
as.integer(1),
pp = as.double(q),
as.double(q),
as.integer(length(fit$knots)),
as.integer(length(q)),
PACKAGE = "logspline")
zz <- z$pp[sq]
if(fit$bound[1] > 0)
zz[q<fit$bound[2]] <- 0
if(fit$bound[3] > 0)
zz[q>fit$bound[4]] <- 1
zz
fitx <- oldlogspline.to.logspline(fit)
plogspline(q,fitx)
}
qoldlogspline <- function(p, fit)
{
if(class(fit)!="oldlogspline")
stop("fit is not an oldlogspline object")
p <- unstrip(p)
sp <- rank(p)
p <- sort(p)
z <- .C("pqlsd",
as.double(fit$coef),
as.double(fit$knots),
as.double(fit$bound),
as.integer(0),
as.double(p),
qq = as.double(p),
as.integer(length(fit$knots)),
as.integer(length(p)),
PACKAGE = "logspline")
zz <- z$qq[sp]
zz[p<0] <- NA
zz[p>1] <- NA
zz
fitx <- oldlogspline.to.logspline(fit)
qlogspline(p,fitx)
}
roldlogspline <- function(n, fit)
......
This diff is collapsed.
......@@ -2144,7 +2144,12 @@ int *ipq,*lk,*lp;
if(i<nk && i>0){
j=floor((double)(i-1)/4.);
r=(double)i/4.-j-0.25;
kpl[i]=(1.-r)*knots[j]+r*knots[j+1];
if(r>0.01){
kpl[i]=(1.-r)*knots[j]+r*knots[j+1];
}
else {
kpl[i]=(1.-r)*knots[j];
}
}
if(i==0){
kpl[0]=knots[0]-1;
......
......@@ -9,14 +9,12 @@
extern void logcensor(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
extern void nlogcensor(void *, void *, void *, void *, void *, void *);
extern void nlogcensorx(void *);
extern void pqlsd(void *, void *, void *, void *, void *, void *, void *, void *);
extern void rpqlsd(void *, void *, void *, void *, void *, void *, void *);
static const R_CMethodDef CEntries[] = {
{"logcensor", (DL_FUNC) &logcensor, 13},
{"nlogcensor", (DL_FUNC) &nlogcensor, 6},
{"nlogcensorx", (DL_FUNC) &nlogcensorx, 1},
{"pqlsd", (DL_FUNC) &pqlsd, 8},
{"rpqlsd", (DL_FUNC) &rpqlsd, 7},
{NULL, NULL, 0}
};
......
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