density.lengths {spMC}R Documentation

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 class 'lengths'
density(x, ..., log = FALSE, zeros.rm = TRUE)

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.

Details

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

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.

Author(s)

Luca Sartore drwolf85@gmail.com

References

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

See Also

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

Examples


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)

[Package spMC version 0.3.15 Index]