spatstat.univar-package {spatstat.univar}R Documentation

The spatstat.univar Package

Description

The spatstat.univar package belongs to the spatstat family of packages. It provides utilities for estimating the probability distribution of one-dimensional (real-valued) data.

Details

This package is a member of the spatstat family of packages. It provides utilities for estimation of the probability distribution of one-dimensional (i.e. numerical, real-valued) data. The utilities include:

kernel density estimation:

including unnormalised weighted densities, and cumulative distribution functions of density estimates.

weighted distributions and weighted statistics:

including weighted empirical cumulative distributions, weighted median, weighted quantiles, calculating the CDF from a density estimate

estimation for right-censored data:

including Kaplan-Meier, reduced-sample and other estimators of the cumulative distribution function and hazard function from right-censored data

quantiles:

including calculation of quantiles from an empirical cumulative distribution or a kernel density estimate

kernels:

including calculation of the probability density, cumulative distribution function, quantiles, random generation, moments and partial moments of the standard smoothing kernels

heat kernel:

calculation of the one-dimensional heat kernel in an interval

integration:

Numerical integration including Stieltjes integrals and indefinite integrals.

The facilities are described in more detail below.

Kernel density estimation

The package supports fixed-bandwidth and variable-bandwidth kernel estimation of probability densities from numerical data. It provides boundary corrections for kernel estimates of densities on the positive half-line (applicable when the original observations are positive numbers) for both fixed-bandwidth and variable-bandwidth estimates.

If the observations have numerical weights associated with them, these weights will not be automatically normalised, and indeed the weights may be negative or zero. This is unlike the standard R method density.default.

The main functions are:

unnormdensity extension of density.default allowing weights to be negative or zero.
densityAdaptiveKernel adaptive (variable-bandwidth) kernel estimate
bw.abram.default calculate data-dependent bandwidths using Abramson rule
CDF.density cumulative distribution function from kernel density estimate

Weighted distributions and weighted statistics

Weighted versions of standard operations such as the histogram and empirical distribution function are provided:

whist weighted histogram
ewcdf weighted empirical cumulative distribution function
mean.ewcdf mean of weighted ecdf
quantile.ewcdf quantiles of weighted ecdf
weighted.median weighted median of numeric values
weighted.quantile weighted quantile of numeric values

Estimation for right-censored data

Facilities are provided for estimating the probability distribution of right-censored lifetimes (non-negative real random variables).

kaplan.meier Kaplan-Meier estimator of cumulative distribution function and hazard rate, from right-censored data
reduced.sample reduced-sample estimator of cumulative distribution function, from right-censored data

Quantiles

Facilities are provided for computing the quantiles of a probability distribution, given estimates of the probability density or the cumulative distribution function and so on.

CDF.density cumulative distribution function from kernel density estimate
quantile.density quantiles of kernel density estimate
quantile.ewcdf quantiles of weighted ecdf
quantilefun quantiles as a function
quantilefun.ewcdf quantiles as a function
weighted.quantile weighted quantile of numeric values
transformquantiles transform the quantiles of a dataset

Kernels

The standard R function density.default recognises a list of smoothing kernels by name: "gaussian", "rectangular", "triangular", "epanechnikov", "biweight", "cosine" and "optcosine". For these kernels, spatstat.univar provides various characteristics:

dkernel probability density of the kernel
pkernel cumulative distribution function of the kernel
qkernel quantiles of the kernel
rkernel generate simulated realisations from the kernel
kernel.factor scale factor relating bandwidth to half-width of kernel
kernel.moment partial moment of kernel
kernel.squint integral of squared kernel

Heat kernels

The heat kernel in an interval can be calculated.

hotrod calculate the heat kernel in an interval

Integration

A few facilities are provided for calculating integrals of real functions.

indefinteg indefinite integral
integral.density integral of a kernel density estimate
stieltjes Stieltjes integral

Utilities

A few utilities for numerical data are also provided.

uniquemap.default map duplicates to unique entries
rounding.default determine whether values have been rounded
firstdigit leading digit in decimal representation
lastdigit least significant digit in decimal representation
ndigits number of digits in decimal representation

Licence

This library and its documentation are usable under the terms of the "GNU General Public License", a copy of which is distributed with the package.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Tilman Davies Tilman.Davies@otago.ac.nz, Martin Hazelton Martin.Hazelton@otago.ac.nz, Ege Rubak rubak@math.aau.dk, Rolf Turner rolfturner@posteo.net and Greg McSwiggan.


[Package spatstat.univar version 3.0-0 Index]