# Calculate density and probability of standartized PGN
# distribution
# distribution parameters
pc <- c(0.5, -0.2)
# function arguments
x <- c(-0.3, 0.8, 1.5)
# probability density function
dhpa0(x, pc)
# cumulative distribution function
phpa0(x, pc)
# Additionally calculate gradients respect to arguments
# and parameters of the PGN distribution
dhpa0(x, pc, is_grad = TRUE)
phpa0(x, pc, is_grad = TRUE)
# Let's denote by X standardized PGN random variable and repeat
# calculations for 2 * X + 1
dhpa0(x, pc, is_grad = TRUE, mean = 1, sd = 2)
phpa0(x, pc, is_grad = TRUE, mean = 1, sd = 2)
Run the code above in your browser using DataLab