MCPcopy
hub / github.com/dask/dask / skewtest

Function skewtest

dask/array/stats.py:265–291  ·  view source on GitHub ↗
(a, axis=0, nan_policy="propagate")

Source from the content-addressed store, hash-verified

263
264@derived_from(scipy.stats)
265def skewtest(a, axis=0, nan_policy="propagate"):
266 if nan_policy != "propagate":
267 raise NotImplementedError(
268 "`nan_policy` other than 'propagate' have not been implemented."
269 )
270
271 b2 = skew(a, axis)
272 n = float(a.shape[axis])
273 if n < 8:
274 raise ValueError(
275 f"skewtest is not valid with less than 8 samples; {int(n)} samples were given."
276 )
277 y = b2 * math.sqrt(((n + 1) * (n + 3)) / (6.0 * (n - 2)))
278 beta2 = (
279 3.0
280 * (n**2 + 27 * n - 70)
281 * (n + 1)
282 * (n + 3)
283 / ((n - 2.0) * (n + 5) * (n + 7) * (n + 9))
284 )
285 W2 = -1 + math.sqrt(2 * (beta2 - 1))
286 delta = 1 / math.sqrt(0.5 * math.log(W2))
287 alpha = math.sqrt(2.0 / (W2 - 1))
288 y = np.where(y == 0, 1, y)
289 Z = delta * np.log(y / alpha + np.sqrt((y / alpha) ** 2 + 1))
290
291 return delayed(SkewtestResult, nout=2)(Z, 2 * distributions.norm.sf(np.abs(Z)))
292
293
294@derived_from(scipy.stats)

Callers 1

normaltestFunction · 0.85

Calls 4

delayedFunction · 0.90
skewFunction · 0.85
whereMethod · 0.45
absMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…