Compute density (mlx_dlogis), cumulative distribution (mlx_plogis),
and quantile (mlx_qlogis) functions for the logistic distribution using MLX.
Usage
mlx_dlogis(
x,
location = 0,
scale = 1,
log = FALSE,
device = mlx_default_device()
)
mlx_plogis(x, location = 0, scale = 1, device = mlx_default_device())
mlx_qlogis(p, location = 0, scale = 1, device = mlx_default_device())Arguments
- x
Vector of quantiles (mlx array or coercible to mlx)
- location, scale
Location and scale parameters (default: 0, 1)
- log
If
TRUE, return log density formlx_dlogis(default:FALSE)- device
Execution target: supply
"gpu","cpu", or anmlx_streamcreated viamlx_new_stream(). Defaults to the currentmlx_default_device()unless noted otherwise (helpers that act on an existing array typically reuse that array's device or stream).- p
Vector of probabilities (mlx array or coercible to mlx)
Examples
x <- as_mlx(seq(-3, 3, by = 0.5))
mlx_dlogis(x)
#> mlx array [13]
#> dtype: float32
#> device: cpu
#> values:
#> [1] 0.04517667 0.07010371 0.10499357 0.14914644 0.19661194 0.23500369
#> [7] 0.25000000 0.23500372 0.19661194 0.14914645 0.10499360 0.07010371
#> [13] 0.04517666
mlx_plogis(x)
#> mlx array [13]
#> dtype: float32
#> device: cpu
#> values:
#> [1] 0.04742588 0.07585818 0.11920293 0.18242553 0.26894143 0.37754068
#> [7] 0.50000000 0.62245935 0.73105860 0.81757444 0.88079703 0.92414182
#> [13] 0.95257413
p <- as_mlx(c(0.25, 0.5, 0.75))
mlx_qlogis(p)
#> mlx array [3]
#> dtype: float32
#> device: cpu
#> values:
#> [1] -1.098612 0.000000 1.098612