dnorm_parallel {hpa}R Documentation

Calculate normal pdf in parallel

Description

Calculate in parallel for each value from vector x density function of normal distribution with mean equal to mean and standard deviation equal to sd.

Usage

dnorm_parallel(x, mean = 0, sd = 1, is_parallel = FALSE)

Arguments

x

numeric vector of quantiles.

mean

double value.

sd

double positive value.

is_parallel

if TRUE then multiple cores will be used for some calculations. It usually provides speed advantage for large enough samples (about more than 1000 observations).

Examples

## Consider normal distribution with mean 3 and standard deviation 5.
## Calculate its density function at points 2 and 3.

# Create vector of points
my_points <- c(2, 3)

# Calculate pdf at these points 
# (set is_parallel = TRUE in order 
# to turn on parallel computations)
dnorm_parallel(my_points, 3, 5, 
               is_parallel = FALSE)

[Package hpa version 1.3.3 Index]