Title: | Non-Parametric Estimation of the Off-Pulse Interval of a Pulsar |
---|---|
Description: | Provides functions to non-parametrically estimate the off-pulse interval of a source function originating from a pulsar. The technique is based on a sequential application of P-values obtained from goodness-of-fit tests for the uniform distribution, such as the Kolmogorov-Smirnov, Cramer-von Mises, Anderson-Darling and Rayleigh goodness-of-fit tests. |
Authors: | Willem Daniel Schutte |
Maintainer: | Willem Daniel Schutte <[email protected]> |
License: | GPL-3 |
Version: | 1.6 |
Built: | 2024-12-08 07:01:16 UTC |
Source: | CRAN |
The package 'SOPIE' provides functions to non-parametrically estimate the off-pulse interval of a source function originating from a pulsar.
This technique is based on a sequential application of P-values
obtained from goodness-of-fit tests for the uniform distribution. The well-known Kolmogorov-Smirnov, Cramer-von Mises,
Anderson-Darling and Rayleigh test statistics are applied sequentially on subintervals of .
The most important functions in the package
are combined in a wrapper function called SOPIE
. Users should start by looking at the documentation of the function findh
, circ.kernel
and SOPIE
.
Package: | SOPIE |
Type: | Package |
Version: | 1.6 |
Date: | 2022-02-23 |
License: | GPL-3 |
LazyLoad: | yes |
The SOPIE package consists of 4 main functions. Each of these functions are
discussed in terms of its functioning, structure, arguments and output in the help documentation of each function.
findh
is the function used to obtain the estimated smoothing parameter that will be
used in the circular kernel density estimator.
circ.kernel
is the function used to perform circular kernel density estimation on the
sample data set in order to obtain the minimum points of the kernel density estimator.
This is essentially the first step of the suggested procedure, as described in the second reference listed below. The output can also
be used to draw a graph of the circular kernel density estimator.
a.estimate
and b.estimate
is almost identical function. a.estimate
is the function
used to obtain the estimated values of , i.e.
, for the off-pulse interval of a pulsar light curve.
b.estimate
is the function
used to obtain the estimated values of , i.e.
, for the off-pulse interval of a pulsar light curve.
SOPIE
is a wrapper-function in the sense that it utilises all of the above function to produce
the estimated off-pulse intervals in an easy readable matrix format, together with
a graph consisting of the histogram estimate of the sample data, the kernel density
estimator and an indication of the estimated median off-pulse interval.
Willem Daniel Schutte
Maintainer: Willem Daniel Schutte
Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, World Scientific Publishing Co. Pte. Ltd.
Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light
curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199
Schutte WD, Swanepoel JWH (2016). SOPIE: an R package for the non-parametric estimation of the off-pulse interval of a pulsar light curve. Monthly Notices of the Royal Astronomical Society, 461, 627-640.
set.seed(777) simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
set.seed(777) simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
a.estimate
and b.estimate
is almost identical function. a.estimate
is the function
used to obtain the estimated values of , i.e.
, for the off-pulse interval of a pulsar light curve.
b.estimate
is the function
used to obtain the estimated values of , i.e.
, for the off-pulse interval of a pulsar light curve.
a.estimate(data, to = 1, min_points, alpha = 0.05, g = 1, r = 1)
a.estimate(data, to = 1, min_points, alpha = 0.05, g = 1, r = 1)
data |
the data vector used to estimate |
to |
the value of the maximum domain of the data. Values will usually
either be 1 or 2 |
min_points |
the scalar or vector containing the value(s) of the minimum point(s)
calculated during the kernel density estimation. This argument does not represent
the index value(s) of the observations within data. The minimum point(s) can be obtained with the function |
alpha |
significance level ( |
g |
the value of the incremental growth of each subsequent
interval over which uniformity is tested. In the suggested procedure, uniformity is
sequentially tested, with the interval used in the test growing by |
r |
the number of subsequent intervals that must
result in the rejection of uniformity before the function will stop. The choice of |
a list containing the following components:
summary |
a vector containing the estimated value of |
general |
a list containing the function call, the minimum value(s) used in the
estimation, the level of significance ( |
Willem Daniel Schutte
D'Agostino, R. & Stephens, M. (eds) (1986). Goodness-of-t techniques, Marcel Dekker, Inc.
Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, World Scientific Publishing Co. Pte. Ltd.
Marsaglia G, Marsaglia J (2004). Evaluating the Anderson-Darling Distribution. Journal of Statistical software, 9, 1-5.
Marsaglia G, Tsang WW, Wang J (2003). Evaluating Kolmogorov's Distribution. Journal of Statistical Software, 8(18), 1-4.
Schutte WD, Swanepoel JWH (2016). SOPIE: an R package for the non-parametric estimation of the off-pulse interval of a pulsar light curve. Monthly Notices of the Royal Astronomical Society, 461, 627-640.
Stephens M (1970). Use of the Kolmogorov-Smirnov, Cramer-Von Mises and related statistics without extensive tables. Journal of the Royal Statistical Society. Series B (Methodological), 32, 115-122.
ad.test
, ks.test
, rayleigh.test
## This function is to be used inside the wrapper function SOPIE simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
## This function is to be used inside the wrapper function SOPIE simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
a.estimate
and b.estimate
is almost identical function. a.estimate
is the function
used to obtain the estimated values of , i.e.
for the off-pulse interval of a pulsar light curve.
b.estimate
is the function
used to obtain the estimated values of , i.e.
, for the off-pulse interval of a pulsar light curve.
b.estimate(data, to = 1, min_points, alpha = 0.05, g = 1, r = 1)
b.estimate(data, to = 1, min_points, alpha = 0.05, g = 1, r = 1)
data |
the data vector used to estimate |
to |
the value of the maximum domain of the data. Values will usually
either be 1 or 2 |
min_points |
a scalar or vector containing the value(s) of the minimum point(s)
calculated during the kernel density estimation. This argument does not represent
the index value(s) of the observations within data. The minimum point(s) can be obtained with the function |
alpha |
significance level ( |
g |
the value of the incremental growth of each subsequent
interval over which uniformity is tested. In the suggested procedure, uniformity is
sequentially tested, with the interval used in the test growing by |
r |
the number of subsequent intervals that must
result in the rejection of uniformity before the function will stop. The choice of |
a list containing the following components:
summary |
a vector containing the estimated value of b, i.e. |
$general |
a list containing the function call, the minimum value(s) used in the
estimation, the level of significance ( |
Willem Daniel Schutte
D'Agostino, R. & Stephens, M. (eds) (1986). Goodness-of-t techniques, Marcel Dekker, Inc.
Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, World Scientific Publishing Co. Pte. Ltd.
Marsaglia G, Marsaglia J (2004). Evaluating the Anderson-Darling Distribution. Journal of Statistical software, 9, 1-5.
Marsaglia G, Tsang WW, Wang J (2003). Evaluating Kolmogorov's Distribution. Journal of Statistical Software, 8(18), 1-4.
Schutte WD, Swanepoel JWH (2016). SOPIE: an R package for the non-parametric estimation of the off-pulse interval of a pulsar light curve. Monthly Notices of the Royal Astronomical Society, 461, 627-640.
Stephens M (1970). Use of the Kolmogorov-Smirnov, Cramer-Von Mises and related statistics without extensive tables. Journal of the Royal Statistical Society. Series B (Methodological), 32, 115-122.
ad.test
, ks.test
, rayleigh.test
## This function is to be used inside the wrapper function SOPIE simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
## This function is to be used inside the wrapper function SOPIE simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
This function is used to perform circular kernel density estimation on the sample data set in order to obtain the minimum points of the kernel density estimator.
circ.kernel(data, sp, to = 1, grid = 512, m = 1)
circ.kernel(data, sp, to = 1, grid = 512, m = 1)
data |
the data vector from which the circular kernel density estimator is to be computed. |
sp |
a real value |
to |
the value of the maximum domain of the data. Values will usually
either be 1 or 2 |
grid |
the number of equally spaced grid points at which the density is to be estimated. |
m |
the number of local minimum points included in the output. |
The Epanechnikov kernel function is used in the circular kernel density estimation. Circular kernel density estimation is perform according to the method proposed in 'Topics in circular statistics' (see references).
a list containing the following components:
x |
a vector of sorted |
y |
a vector of density-values of the circular kernel density estimator corresponding to |
minimum |
a vector of the kernel grid point(s) of lowest density
derived from the circular kernel density estimator. The length of the vector will depend on the choice of |
Willem Daniel Schutte
Hall P, Watson G, Cabrera J (1987). Kernel density estimation with spherical data.
Biometrika, 74 (4), 751-762.
Jammalamadaka S, SenGupta A (2001). Topics in circular statistics. World Scientific Publishing
Co. Pte. Ltd.
Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light
curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199
Schutte WD, Swanepoel JWH (2016). SOPIE: an R package for the non-parametric estimation of the off-pulse interval of a pulsar light curve. Monthly Notices of the Royal Astronomical Society, 461, 627-640.
Sheather, S. & Jones, M. (1991). A reliable data-based bandwidth selection method for kernel
density estimation, Journal of the Royal Statistical Society, Series B, 53:683-690.
Silverman, B. (1986). Density estimation for Statistics and Data analysis, Chapman and Hall.
Taylor, C. (2008). Automatic bandwith selection for circular density estimation, Computational
Statistics & Data Analysis, 52:3493-3500.
Wand, M. & Jones, M. (1995). Kernel Smoothing, Chapman and Hall.
simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) circ.kernel(simdata, findh(simdata), to = 1, grid = 512, m = 1)
simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) circ.kernel(simdata, findh(simdata), to = 1, grid = 512, m = 1)
This data set contains n=21145 time of arrivals of photons with energies above 100MeV of PSR J0534+2200 (Crab-pulsar), obtained from the Fermi LAT.
data(crab)
data(crab)
A vector containing 21145 observation.
Obtained from Fermi LAT, energies above 100 MeV.
Abdo A, et al. (2010b). Fermi large area telescope observations of the Crab pulsar and
nebula. The Astronomical Journal, 708, 1254-1267.
data(crab) SOPIE(crab)
data(crab) SOPIE(crab)
This function is used to obtain the estimated smoothing parameter that will be
used in the circular kernel density estimator (see
circ.kernel
).
findh(data, h = 1, to = 1)
findh(data, h = 1, to = 1)
data |
the data vector from which to calculate the estimated
smoothing parameter |
|||||||||
h |
integer value from 1 to 9, specifying the smoothing parameter to calculate according to the following table:
|
|||||||||
to |
the value of the maximum domain of the data. Values will usually
either be 1 or 2 |
The function produces a single real value between 0 and 1, representing the rounded value (to 2 decimal places) of the estimating smoothing parameter.
Willem Daniel Schutte
Hall P, Watson G, Cabrera J (1987). Kernel density estimation with spherical data.
Biometrika, 74 (4), 751-762.
Jammalamadaka S, SenGupta A (2001). Topics in circular statistics. World Scientific Publishing
Co. Pte. Ltd.
Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light
curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199
Schutte WD, Swanepoel JWH (2016). SOPIE: an R package for the non-parametric estimation of the off-pulse interval of a pulsar light curve. Monthly Notices of the Royal Astronomical Society, 461, 627-640.
Sheather, S. & Jones, M. (1991). A reliable data-based bandwidth selection method for kernel
density estimation, Journal of the Royal Statistical Society, Series B, 53:683-690.
Silverman, B. (1986). Density estimation for Statistics and Data analysis, Chapman and Hall.
Taylor, C. (2008). Automatic bandwith selection for circular density estimation, Computational
Statistics & Data Analysis, 52:3493-3500.
Wand, M. & Jones, M. (1995). Kernel Smoothing, Chapman and Hall.
simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) findh(simdata,h=9,to=1)
simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) findh(simdata,h=9,to=1)
This data set contains n=21153 time of arrivals of photons with energies above 100MeV of PSR J1709-44290, obtained from the Fermi LAT.
data(J1709)
data(J1709)
A vector containing 21153 observation.
Obtained from Fermi LAT, energies above 100 MeV
Abdo A, et al. (2010). "The first Fermi large area telescope catalog of gamma-ray pulsars."
The Astrophysical Journal Supplement Series, 187, 460-494.
data(J1709) SOPIE(J1709)
data(J1709) SOPIE(J1709)
This simulated data set contains n=5000 observations from a scaled Von Mises distribution with noise (; c = 0.3;
).
Similar data sets can be generated with the function
von_mises_sim
.
data(simdata)
data(simdata)
A vector containing 5000 observations.
Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light
curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199
data(simdata) hist(simdata) SOPIE(simdata)
data(simdata) hist(simdata) SOPIE(simdata)
SOPIE
is a wrapper-function that utilises findh
, circ.kernel
, a.estimate
and b.estimate
to produce the estimated off-pulse intervals in an easy readable matrix format, together with
a graph.
SOPIE(data, h = 1, to = 1, alpha = 0.05, g = 20, r = 10, m = 1, grid = 512)
SOPIE(data, h = 1, to = 1, alpha = 0.05, g = 20, r = 10, m = 1, grid = 512)
data |
the data vector within which to find the estimated
smoothing parameter |
|||||||||
h |
integer value from 1 to 9, specifying the smoothing parameter to calculate according to the following table:
|
|||||||||
to |
the value of the maximum domain of the data. Values will usually
either be 1 or 2 |
|||||||||
alpha |
significance level ( |
|||||||||
g |
the value of the incremental growth of each subsequent
interval over which uniformity is tested. In the suggested procedure, uniformity is
sequentially tested, with the interval used in the test growing by |
|||||||||
r |
the number of subsequent intervals that must
result in the rejection of uniformity before the function will stop. The choice of |
|||||||||
m |
the number of local minimum points included in the output. |
|||||||||
grid |
the number of equally spaced grid points at which the density is to be estimated. |
SOPIE is a wrapper-function in the sense that it utilises the function findh
, circ.kernel
, a.estimate
and b.estimate
to produce
the estimated off-pulse intervals of a pulsar light curve in an easy readable matrix format, together with
a graph consisting of the histogram estimate of the sample data, the kernel density
estimator, and a visual representation of the estimated off-pulse intervals.
The output produced by the function is a list containing the following:
summary |
is a matrix that contains the estimated value of |
general |
is a list containing the function call, the minimum value(s) used in the
estimation, the level of significance ( |
A histogram estimate of the data is produced with the circular kernel density estimate overlaid. An indication of the estimated median off-pulse interval derived from the four goodness-of-fit tests is illustrated with two solid vertical lines.
Willem Daniel Schutte
Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light
curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199.
Schutte WD, Swanepoel JWH (2016). SOPIE: an R package for the non-parametric estimation of the off-pulse interval of a pulsar light curve. Monthly Notices of the Royal Astronomical Society, 461, 627-640.
set.seed(777) simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100) data(crab) SOPIE(crab) data(J1709) SOPIE(J1709)
set.seed(777) simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100) data(crab) SOPIE(crab) data(J1709) SOPIE(J1709)
Generates simulated data over the interval from a scaled Von Mises distribution with noise.
von_mises_sim(n = 5000, k = 1, c = 0.3, noise = 0.2)
von_mises_sim(n = 5000, k = 1, c = 0.3, noise = 0.2)
n |
number of random variates in the simulated data set. |
k |
concentration parameter |
c |
the point of truncation of the Von Mises distribution. The value of c represent that value in the interval |
noise |
proportion of random noise to include in the simulated data set. If |
The output vector of this function is random variates in the interval
from a scaled Von Mises density with uniform noise proportional to
noise
.
Willem Daniel Schutte
Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, World Scientific Publishing Co. Pte. Ltd.
Robert CP, Casella G (2010). Introducing Monte Carlo methods with R. Springer.
Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light
curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199
set.seed(777) simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) hist(simdata) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)
set.seed(777) simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2) hist(simdata) SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)