Learn R Programming

retistruct (version 0.6.3)

compute.kernel.estimate: Kernel estimate over grid

Description

Compute a kernel estimate over a grid and do a contour analysis of this estimate. The contour heights the determined by finding heights that exclude a certain fraction of the probability. For example, the 95 and it should enclose about 5 are specified by the contour.levels option; by default they are c(5, 25, 50, 75, 95).

Usage

compute.kernel.estimate(Dss, phi0, fhat, compute.conc)

Arguments

Dss

List of datasets. The first two columns of each datasets are coordinates of points on the sphere in spherical polar (latitude, phi, and longitude, lambda) coordinates. In the case kernel smoothing, there is a third column of values of dependent variables at those points.

phi0

Rim angle in radians

fhat

Function such as kde.fhat or kr.yhat to compute the density given data and a value of the concentration parameter kappa of the Fisher density.

compute.conc

Function to return the optimal value of the concentration parameter kappa given the data.

Value

A list containing

kappa

The concentration parameter

h

A pseudo-bandwidth parameter, the inverse of the square root of kappa. Units of degrees.

flevels

Contour levels.

labels

Labels of the contours.

g

Raw density estimate drawn on non-area-preserving projection. Comprises locations of gridlines in Cartesian coordinates (xs and ys), density estimates at these points, f and location of maximum in Cartesian coordinates (max).

gpa

Raw density estimate drawn on area-preserving projection. Comprises same elements as above.

contour.areas

Area of each individual contour. One level may have more than one contour; this shows the areas of all such contours.

tot.contour.areas

Data frame containing the total area within the contours at each level.