Learn R Programming

UPMASK (version 1.2)

create_randomKde2d: Compute the density based distance quantity using a 2D Kernel Density Estimation

Description

create_randomKde2d will compute the 2D Kernel Density Estimation for a random sampling of the requested number of points and will return the quantiy (max(d)-mean(d))/sd(d), if the option returnDistance is set to TRUE.

Usage

create_randomKde2d(nstars, maxX, maxY, nKde=50, printPlots=FALSE, 
showStats=FALSE, returnDistance=FALSE)

Arguments

nstars

an integer with the number of stars to consider

maxX

the length of the field in X

maxY

the length of the field in Y

nKde

the number of samplings of the kernel in each direction

printPlots

a boolean indicating if the user wants to see plots

showStats

a boolean indicating if the user wants to see statistics

returnDistance

a boolean indicating if the user wants statistics to be returned

Value

A double representing the density based distance quantity.

References

Krone-Martins, A. & Moitinho, A., A&A, v.561, p.A57, 2014

Examples

Run this code
# NOT RUN {
# Compute the density based distance quantity with random fields
distVar <- create_randomKde2d(100, 10, 10, showStats=FALSE, 
                              printPlots=FALSE, returnDistance=TRUE)

# Clean the environment
rm(distVar)
 
# }

Run the code above in your browser using DataLab