eye_density.fixation_group: Compute a density map for a fixation group.

View source: R/similarity.R

eye_density.fixation_groupR Documentation

Compute a density map for a fixation group.

Description

This function computes a density map for a given fixation group using kernel density estimation.

Usage

## S3 method for class 'fixation_group'
eye_density(
  x,
  sigma = 50,
  xbounds = c(min(x$x), max(x$x)),
  ybounds = c(min(x$y), max(x$y)),
  outdim = c(xbounds[2] - xbounds[1], ybounds[2] - ybounds[1]),
  normalize = TRUE,
  duration_weighted = FALSE,
  window = NULL,
  origin = c(0, 0)
)

Arguments

x

A fixation_group object.

sigma

The standard deviation of the kernel. Default is 50.

xbounds

The x-axis bounds. Default is the range of x values in the fixation group.

ybounds

The y-axis bounds. Default is the range of y values in the fixation group.

outdim

The output dimensions of the density map. Default is the difference between the xbounds and ybounds.

normalize

Whether to normalize the output map. Default is TRUE.

duration_weighted

Whether to weight the fixations by their duration. Default is FALSE.

window

The temporal window over which to compute the density map. Default is NULL.

origin

The origin of the coordinate system. Default is c(0,0).

Details

The function computes a density map for a given fixation group using the kde2d function from the MASS package. The density map is computed based on the x and y coordinates of the fixations, with optional weighting by their duration. The resulting density map can be normalized if desired.

Value

An object of class c("eye_density", "density", "list") containing the computed density map and other relevant information.

See Also

Other eye_density: eye_density()


bbuchsbaum/eyesim documentation built on May 9, 2023, 3:29 a.m.