Skip to content

Commit 4b6077f

Browse files
committed
Improved documentation
1 parent 8d882d7 commit 4b6077f

File tree

5 files changed

+56
-18
lines changed

5 files changed

+56
-18
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: spatstat.univar
2-
Version: 3.1-1.001
3-
Date: 2025-02-23
2+
Version: 3.1-1.002
3+
Date: 2025-02-25
44
Title: One-Dimensional Probability Distribution Support for the 'spatstat' Family
55
Authors@R: c(person("Adrian", "Baddeley",
66
role = c("aut", "cre", "cph"),

NEWS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
CHANGES IN spatstat.univar VERSION 3.1-1.001
1+
CHANGES IN spatstat.univar VERSION 3.1-1.002
22

33
OVERVIEW
44

5-
o Internal improvements.
5+
o Improvements to documentation.
66

7+
o Internal improvements.
78

89
CHANGES IN spatstat.univar VERSION 3.1-1
910

inst/doc/packagesizes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
55
"2024-09-05" "3.0-1" 30 60 0 1742 321
66
"2024-11-05" "3.1-0" 36 68 0 2571 2233
77
"2024-11-05" "3.1-1" 36 68 0 2571 2235
8-
"2025-02-23" "3.1-1.001" 36 68 0 2577 2235
8+
"2025-02-25" "3.1-1.002" 36 68 0 2577 2235

inst/info/packagesizes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
55
"2024-09-05" "3.0-1" 30 60 0 1742 321
66
"2024-11-05" "3.1-0" 36 68 0 2571 2233
77
"2024-11-05" "3.1-1" 36 68 0 2571 2235
8-
"2025-02-23" "3.1-1.001" 36 68 0 2577 2235
8+
"2025-02-25" "3.1-1.002" 36 68 0 2577 2235

man/densityBC.Rd

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,47 +83,67 @@
8383
}
8484
}
8585
\details{
86-
If \code{zerocor} is absent or given as \code{"none"},
86+
If \code{zerocor} is missing, or given as \code{"none"},
8787
this function computes the fixed bandwidth kernel estimator of the
8888
probability density on the real line.
8989
9090
If \code{zerocor} is given, it is assumed that the density
9191
is confined to the positive half-line, and a boundary correction is
92-
applied:
92+
applied to compensate for bias arising due to truncation at the origin:
9393
\describe{
94-
\item{weighted}{The contribution from each point \eqn{x_i}{x[i]}
94+
\item{\code{zerocor="weighted"}:}{
95+
The contribution from each data point \eqn{x_i}{x[i]}
9596
is weighted by the factor \eqn{1/m(x_i)}{1/m(x[i])}
9697
where \eqn{m(x) = 1 - F(-x)} is the total mass of the kernel centred on
9798
\eqn{x} that lies in the positive half-line, and \eqn{F(x)} is the
98-
cumulative distribution function of the kernel}
99-
\item{convolution}{The estimate of the density \eqn{f(r)} is
99+
cumulative distribution function of the kernel.
100+
This is the \dQuote{cut-and-normalization} method of
101+
Gasser and \ifelse{latex}{\out{M\"{u}ller}}{Mueller} (1979).
102+
Effectively the kernel is renormalized so that it integrates to 1,
103+
and the adjusted kernel conserves mass.
104+
}
105+
\item{\code{zerocor="convolution"}:}{
106+
The estimate of the density \eqn{f(r)} is
100107
weighted by the factor \eqn{1/m(r)} where \eqn{m(r) = 1 - F(-r)}
101108
is given above.
109+
This is the \dQuote{convolution}, \dQuote{uniform}
110+
or \dQuote{zero-order} boundary correction method
111+
often attributed to Diggle (1985).
112+
This correction does not conserve mass.
102113
}
103-
\item{reflection}{
114+
\item{\code{zerocor="reflection"}:}{
104115
if the kernel centred at data point \eqn{x_i}{x[i]}
105116
has a tail that lies on the negative half-line, this tail is
106117
reflected onto the positive half-line.
118+
This is the reflection method first proposed by
119+
Boneva et al (1971).
120+
This correction conserves mass.
107121
}
108-
\item{bdrykern}{The density estimate is computed using the
109-
Boundary Kernel associated with the chosen kernel
122+
\item{\code{zerocor="bdrykern"}:}{
123+
The density estimate is computed using the
124+
Linear Boundary Kernel associated with the chosen kernel
110125
(Wand and Jones, 1995, page 47).
111126
That is, when estimating the density \eqn{f(r)} for values of
112127
\eqn{r} close to zero (defined as \eqn{r < h} for all kernels
113128
except the Gaussian), the kernel contribution
114129
\eqn{k_h(r - x_i)}{k[h](r - x[i])} is multiplied by a
115-
term that is a linear function of \eqn{r - x_i}{r - x[i]}.
130+
term that is a linear function of \eqn{r - x_i}{r - x[i]},
131+
with coefficients depending on \eqn{r}.
132+
This correction does not conserve mass and may result in
133+
negative values, but is asymptotically optimal.
116134
}
117-
\item{JonesFoster}{
135+
\item{\code{zerocor="JonesFoster"}:}{
118136
The modification of the Boundary Kernel estimate
119-
proposed by Jones and Foster (1996), equal to
137+
proposed by Jones and Foster (1996) is computed. This is equal to
120138
\eqn{
121139
\overline f(r) \exp( \hat f(r)/\overline f(r) - 1)
122140
}{
123141
f#(r) exp(f*(r)/f#(r) - 1)
124142
}
125143
where \eqn{\overline f(r)}{f#(r)} is the convolution estimator
126-
and \eqn{\hat f(r)}{f*(r)} is the boundary kernel estimator.
144+
and \eqn{\hat f(r)}{f*(r)} is the linear boundary kernel estimator.
145+
This ensures that the estimate is always nonnegative
146+
and retains the asymptotic optimality of the linear boundary kernel.
127147
}
128148
}
129149
If \code{fast=TRUE}, the calculations are performed rapidly using
@@ -152,6 +172,23 @@
152172
\references{
153173
\ournewpaper
154174
175+
Boneva, L.I., Kendall, D.G. and Stefanov, I. (1971)
176+
Spline transformations: three new diagnostic aids for the
177+
statistical data-analyst (with discussion).
178+
\emph{Journal of the Royal Statistical Society, Series B},
179+
\bold{33}, 1–-70.
180+
181+
Diggle, P.J. (1985)
182+
A kernel method for smoothing point process data.
183+
\emph{Journal of the Royal Statistical Society, Series C (Applied Statistics)},
184+
\bold{34} 138–-147.
185+
186+
Gasser, Th. and \ifelse{latex}{\out{M\"{u}ller}}{Mueller}, H.-G. (1979).
187+
Kernel estimation of regression functions.
188+
In Th. Gasser and M. Rosenblatt (editors)
189+
\emph{Smoothing Techniques for Curve Estimation}, pages
190+
23-–68. Springer, Berlin.
191+
155192
Jones, M.C. and Foster, P.J. (1996)
156193
A simple nonnegative boundary correction method for kernel density
157194
estimation.

0 commit comments

Comments
 (0)