The OpenD Programming Language

1 /++
2 This module contains aliases of common functions.
3 
4 License: $(HTTP www.apache.org/licenses/LICENSE-2.0, Apache-2.0)
5 
6 Authors: John Michael Hall
7 
8 Copyright: 2023 Mir Stat Authors.
9 
10 Macros:
11 SUBREF = $(REF_ALTTEXT $(TT $2), $2, mir, stat, $1)$(NBSP)
12 SUB2REF = $(REF_ALTTEXT $(TT $2), $2, mir, stat, descriptive, $1)$(NBSP)
13 MATHREF = $(GREF_ALTTEXT mir-algorithm, $(TT $2), $2, mir, math, $1)$(NBSP)
14 NDSLICEREF = $(GREF_ALTTEXT mir-algorithm, $(TT $2), $2, mir, ndslice, $1)$(NBSP)
15 T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
16 T3=$(TR $(TDNW $(LREF $1)) $(TD $2) $(TD $+))
17 T4=$(TR $(TDNW $(LREF $1)) $(TD $2) $(TD $3) $(TD $4))
18 
19 +/
20 
21 module mir.stat.descriptive.aliases;
22 
23 import mir.stat.descriptive.univariate: standardDeviation, variance, skewness,
24                                         kurtosis, coefficientOfVariation,
25                                         interquartileRange, medianAbsoluteDeviation;
26 import mir.stat.descriptive.multivariate: covariance, correlation;
27 
28 // From univariate
29 ///
30 alias sd = standardDeviation;
31 ///
32 alias var = variance;
33 ///
34 alias skew = skewness;
35 ///
36 alias kurt = kurtosis;
37 ///
38 alias cv = coefficientOfVariation;
39 ///
40 alias iqr = interquartileRange;
41 ///
42 alias mad = medianAbsoluteDeviation;
43 
44 
45 // From multivariate
46 ///
47 alias cov = covariance;
48 ///
49 alias cor = correlation;
50 
51 @safe pure @nogc nothrow
52 unittest
53 {
54     alias a = sd;
55     alias b = sd!double;
56     alias c = sd!"naive";
57 }
58 
59 @safe pure @nogc nothrow
60 unittest
61 {
62     alias a = var;
63     alias b = var!double;
64     alias c = var!"naive";
65 }
66 
67 @safe pure @nogc nothrow
68 unittest
69 {
70     alias a = skew;
71     alias b = skew!double;
72     alias c = skew!"naive";
73 }
74 
75 @safe pure @nogc nothrow
76 unittest
77 {
78     alias a = kurt;
79     alias b = kurt!double;
80     alias c = kurt!"naive";
81 }
82 
83 @safe pure @nogc nothrow
84 unittest
85 {
86     alias a = cv;
87     alias b = cv!double;
88     alias c = cv!"naive";
89 }
90 
91 @safe pure @nogc nothrow
92 unittest
93 {
94     alias a = iqr;
95     alias b = iqr!double;
96     alias c = iqr!"type7";
97 }
98 
99 @safe pure @nogc nothrow
100 unittest
101 {
102     alias a = mad;
103 }
104 
105 @safe pure @nogc nothrow
106 unittest
107 {
108     alias a = cov;
109     alias b = cov!double;
110     alias c = cov!"naive";
111 }
112 
113 @safe pure @nogc nothrow
114 unittest
115 {
116     alias a = cor;
117     alias b = cor!double;
118     alias c = cor!"naive";
119 }