flopscope.stats.laplace.pdf
flopscope.stats.laplace.pdf(x, loc=0, scale=1)[flopscope source]
Evaluate the probability density function.
Parameters
- x:array_like
Points at which to evaluate the density.
- loc:float, optional
Location parameter of the distribution. Defaults to
0.- scale:float, optional
Scale parameter of the distribution. Defaults to
1.
Returns
- :FlopscopeArray
Probability density evaluated elementwise at
x.
Notes
Equivalent to scipy.stats.laplace.pdf(x, loc, scale).
FLOP cost: 22 * numel(x) (composite: |x-loc|(3) + exp(-z)(17) +
/(2*scale)(2), FMA=2, weight 1.0).
system_message
<string>:1: (WARNING/2) Inline substitution_reference start-string without end-string.Examples
>>> import flopscope.numpy as fnp
>>> import flopscope as flops
>>> x = flops.array([-1.0, 0.0, 1.0])
>>> flops.round(flops.stats.laplace.pdf(x), 3)
array([0.184, 0.5 , 0.184])