pfocal_fast: Fast methods for common kernel computations

pfocal_fast_gaussian_radiusR Documentation

Fast methods for common kernel computations

Description

Methods wrapping pfocal to implement common kernel computations with default argument values.

Usage

pfocal_fast_gaussian_radius(
  data,
  vertical_radius,
  vertical_sd = 1,
  horizontal_radius = vertical_radius,
  horizontal_sd = vertical_sd,
  tail_included = TRUE,
  na.rm = NA,
  mp = TRUE,
  debug_use_r_implementation = FALSE,
  ...,
  transform_function = "MULTIPLY",
  reduce_function = "SUM",
  mean_divider = "ONE",
  variance = FALSE
)

pfocal_fast_gaussian_confidence(
  data,
  vertical_r0 = 0.05,
  vertical_sd = 1,
  horizontal_r0 = vertical_r0,
  horizontal_sd = vertical_sd,
  tail_included = TRUE,
  na.rm = NA,
  mp = TRUE,
  debug_use_r_implementation = FALSE,
  ...,
  transform_function = "MULTIPLY",
  reduce_function = "SUM",
  mean_divider = "ONE",
  variance = FALSE
)

pfocal_fast_binomial(
  data,
  vertical_radius,
  horizontal_radius = vertical_radius,
  na.rm = NA,
  mp = TRUE,
  debug_use_r_implementation = FALSE,
  ...,
  transform_function = "MULTIPLY",
  reduce_function = "SUM",
  mean_divider = "ONE",
  variance = FALSE
)

pfocal_fast_abs_rectangle(
  data,
  height,
  width = height,
  value = 1,
  na.rm = NA,
  mp = TRUE,
  debug_use_r_implementation = FALSE,
  ...,
  transform_function = "MULTIPLY",
  reduce_function = "SUM",
  mean_divider = "ONE",
  variance = FALSE
)

pfocal_fast_separated(
  data,
  kernel_list,
  na.rm = NA,
  mp = TRUE,
  debug_use_r_implementation = FALSE,
  ...,
  transform_function = "MULTIPLY",
  reduce_function = "SUM",
  mean_divider = "ONE",
  variance = FALSE
)

Arguments

data

[matrix-type] Grid to compute onto.

vertical_radius

[numeric] The kernel's radius in the vertical dimension.

vertical_sd

[numeric] The kernel's standard deviation in the vertical dimension.

horizontal_radius

[numeric] The kernel's radius in the horizontal dimension.

horizontal_sd

[numeric] The kernel's standard deviation in the horizontal dimension.

tail_included

[logical] Whether or not to include the kernel tail.

na.rm

[NA OR logical] The behavior to adopt for dealing with missing values, default to NA (faster option). For possible values see pfocal_info_nan_policy().

mp

[logical] Whether to use the open_mp implementation, default to TRUE.

debug_use_r_implementation

[logical] Used for debugging purposes whether to use the slow R implementation instead of the fast C++ code. Default to FALSE.

...

None used at the moment .

transform_function

[character] The function to apply to the cell values covered by the kernel. For possible values, see pfocal_info_transform(). Default to "MULTIPLY".

reduce_function

[character] The function to apply to the kernel values after the function passed in transform_function has been applied (the function that summarize the data). For possible values, see pfocal_info_reduce(). Default to "SUM".

mean_divider

[character] Optional, allows to specify how the final value at each cell is divided by a value that can be function of the intermediate data resulting of applying transform_function. For possible values, see pfocal_info_mean_divisor(). Default to "ONE" (for no division).

variance

[logical] Whether to return the "variance" of the intermediate values at each point (for more details please see pfocal_info_variance()). Default to FALSE (just returns the value at each point).

vertical_r0

[numeric] The kernel's r0 (exponential) in the vertical dimension.

horizontal_r0

[numeric] The kernel's r0 (exponential) in the horizontal dimension.

height

[numeric] For rectangular kernels, the height of the rectangle.

width

[numeric] For rectangular kernels, the width of the rectangle.

value

[numeric] For single value matrices, the value.

kernel_list

[list] A list of kernels computed from functions in kernel-gaussian, kernel-binomial, kernel-circular, kernel-distance, kernel-exponential.

Value

The updated, convoluted grid.

Examples


data <- matrix(nrow = 10, ncol = 10, data = runif(10 * 10))

pfocal_fast_gaussian_radius(data, vertical_radius = 2)
pfocal_fast_gaussian_confidence(data)
pfocal_fast_binomial(data, vertical_radius = 2)
pfocal_fast_abs_rectangle(data, height = 2)

pfocal_fast_separated(data, 
                      kernel_list = list(binomial_kernel(vertical_radius = 2, 
                                                         horizontal_radius = 2), 
                                         distance_kernel(vertical_radius = 2,
                                                         horizontal_radius = 2)))


LandSciTech/pfocal documentation built on Aug. 27, 2022, 8:55 a.m.