Learn R Programming

spMC (version 0.3.15)

density.lengths: Empirical Densities Estimation of Stratum Lengths

Description

The function estimates the empirical conditional density of the stratum lengths given the category.

Usage

# S3 method for lengths
density(x, ..., log = FALSE, zeros.rm = TRUE)

Value

An object of class density.lengths is returned. It contains objects of class density, the given direction of the stratum lengths and a logical value which points out if the density is computed for the logarithm of stratum lengths.

Arguments

x

an object of the class lengths, typically with the output of the function getlen.

...

other arguments to pass to the function density.default.

log

a logical value. If TRUE, the output density will be calculated for the logarithm of the lengths. It is TRUE by default.

zeros.rm

a logical value. If FALSE, the density will be estimated by including zero values. It is TRUE by default.

Author

Luca Sartore drwolf85@gmail.com

Details

The function estimates the empirical density of the stratum lengths for each category by the use of the kernel methodology.

References

Simonoff, J. S. (1996) Smoothing Methods in Statistics. Springer-Verlag.

See Also

getlen, density.default, plot.density.lengths, print.density.lengths

Examples

Run this code
# \donttest{
data(ACM)
direction <- c(0,0,1)
     
# Compute the appertaining directional line for each location
loc.id <- which_lines(ACM[, 1:3], direction)
     
# Estimate stratum lengths
gl <- getlen(ACM$MAT3, ACM[, 1:3], loc.id, direction)

# Compute the empirical densities of stratum lengths
dgl <- density(gl)
# }

Run the code above in your browser using DataLab