1
1
module MultivariateStats
2
2
3
- using LinearAlgebra
4
- using SparseArrays
5
- using Statistics: middle
6
- using Distributions: cdf, FDist
7
- using StatsAPI: RegressionModel, HypothesisTest
8
- using StatsBase: SimpleCovariance, CovarianceEstimator, AbstractDataTransform,
9
- ConvergenceException, pairwise, pairwise!, CoefTable
10
-
11
- import Statistics: mean, var, cov, covm, cor
12
- import Base: length, size, show
13
- import StatsAPI: fit, predict, coef, weights, dof, r2, pvalue
14
- import LinearAlgebra: eigvals, eigvecs
15
-
16
- export
3
+ using LinearAlgebra
4
+ using SparseArrays
5
+ using Statistics: middle
6
+ using StatsAPI: RegressionModel
7
+ using StatsBase:
8
+ SimpleCovariance,
9
+ CovarianceEstimator,
10
+ AbstractDataTransform,
11
+ ConvergenceException,
12
+ pairwise,
13
+ pairwise!,
14
+ CoefTable
15
+
16
+ import Statistics: mean, var, cov, covm, cor
17
+ import Base: length, size, show
18
+ import StatsAPI: fit, predict, coef, weights, dof, r2
19
+ import LinearAlgebra: eigvals, eigvecs
20
+
21
+ export
17
22
18
23
# # common
19
24
evaluate, # evaluate discriminant function values
@@ -38,27 +43,23 @@ module MultivariateStats
38
43
39
44
# whiten
40
45
Whitening, # Type: Whitening transformation
41
-
42
46
invsqrtm, # Compute inverse of matrix square root, i.e. inv(sqrtm(A))
43
47
cov_whitening, # Compute a whitening transform based on covariance
44
48
cov_whitening!, # Compute a whitening transform based on covariance (input will be overwritten)
45
49
invsqrtm, # Compute C^{-1/2}, i.e. inv(sqrtm(C))
46
50
47
51
# # pca
48
52
PCA, # Type: Principal Component Analysis model
49
-
50
53
pcacov, # PCA based on covariance
51
54
pcasvd, # PCA based on singular value decomposition of input data
52
55
principalratio, # the ratio of variances preserved in the principal subspace
53
56
principalvar, # the variance along a specific principal direction
54
57
principalvars, # the variances along all principal directions
55
-
56
58
tprincipalvar, # total principal variance, i.e. sum(principalvars(M))
57
59
tresidualvar, # total residual variance
58
60
59
61
# # ppca
60
62
PPCA, # Type: the Probabilistic PCA model
61
-
62
63
ppcaml, # Maximum likelihood probabilistic PCA
63
64
ppcaem, # EM algorithm for probabilistic PCA
64
65
bayespca, # Bayesian PCA
@@ -67,10 +68,7 @@ module MultivariateStats
67
68
KernelPCA, # Type: the Kernel PCA model
68
69
69
70
# # cca
70
- CCA, # Type: Correlation Component Analysis model
71
- WilksLambdaTest, # Wilks lambda statistics and tests
72
- PillaiTraceTest, # Pillai trace statistics and tests
73
- LawleyHotellingTest, # Lawley-Hotelling statistics and tests
71
+ CCA, # Type: Correlation Component Analysis model
74
72
75
73
ccacov, # CCA based on covariances
76
74
ccasvd, # CCA based on singular value decomposition of input data
@@ -81,18 +79,17 @@ module MultivariateStats
81
79
MetricMDS,
82
80
classical_mds, # perform classical MDS over a given distance matrix
83
81
stress, # stress evaluation
84
-
85
- gram2dmat, gram2dmat!, # Gram matrix => Distance matrix
86
- dmat2gram, dmat2gram!, # Distance matrix => Gram matrix
82
+ gram2dmat,
83
+ gram2dmat!, # Gram matrix => Distance matrix
84
+ dmat2gram,
85
+ dmat2gram!, # Distance matrix => Gram matrix
87
86
88
87
# # lda
89
88
LinearDiscriminant, # Type: Linear Discriminant functional
90
89
MulticlassLDAStats, # Type: Statistics required for training multi-class LDA
91
90
MulticlassLDA, # Type: Multi-class LDA model
92
91
SubspaceLDA, # Type: LDA model for high-dimensional spaces
93
-
94
92
ldacov, # Linear discriminant analysis based on covariances
95
-
96
93
classweights, # class-specific weights
97
94
classmeans, # class-specific means
98
95
withclass_scatter, # with-class scatter matrix
@@ -103,56 +100,58 @@ module MultivariateStats
103
100
104
101
# # ica
105
102
ICA, # Type: the Fast ICA model
106
-
107
103
fastica!, # core algorithm function for the Fast ICA
108
104
109
105
# # fa
110
106
FactorAnalysis, # Type: the Factor Analysis model
111
-
112
107
faem, # EM algorithm for factor analysis
113
108
facm, # CM algorithm for factor analysis
114
109
115
110
# # CA, MCA
116
- CA,
117
- MCA,
118
- objectscores,
119
- variablescores,
120
- inertia
121
-
122
- # # source files
123
- include (" types.jl" )
124
- include (" common.jl" )
125
- include (" lreg.jl" )
126
- include (" whiten.jl" )
127
- include (" pca.jl" )
128
- include (" ppca.jl" )
129
- include (" kpca.jl" )
130
- include (" cca.jl" )
131
- include (" cmds.jl" )
132
- include (" mmds.jl" )
133
- include (" lda.jl" )
134
- include (" ica.jl" )
135
- include (" fa.jl" )
136
- include (" mca.jl" )
137
-
138
- # # deprecations
139
- @deprecate indim (f) size (f,1 )
140
- @deprecate outdim (f) size (f,2 )
141
- @deprecate transform (f, x) predict (f, x)
142
- @deprecate indim (f:: Whitening ) length (f:: Whitening )
143
- @deprecate outdim (f:: Whitening ) length (f:: Whitening )
144
- @deprecate tvar (f:: PCA ) var (f:: PCA )
145
- @deprecate classical_mds (D:: AbstractMatrix , p:: Int ) predict (fit (MDS, D, maxoutdim= p, distances= true ))
146
- @deprecate transform (f:: MDS ) predict (f:: MDS )
147
- @deprecate xindim (M:: CCA ) size (M,1 )
148
- @deprecate yindim (M:: CCA ) size (M,2 )
149
- @deprecate outdim (M:: CCA ) size (M,3 )
150
- @deprecate correlations (M:: CCA ) cor (M)
151
- @deprecate xmean (M:: CCA ) mean (M, :x )
152
- @deprecate ymean (M:: CCA ) mean (M, :y )
153
- @deprecate xprojection (M:: CCA ) projection (M, :x )
154
- @deprecate yprojection (M:: CCA ) projection (M, :y )
155
- @deprecate xtransform (M:: CCA , x) predict (M, x, :x )
156
- @deprecate ytransform (M:: CCA , y) predict (M, y, :y )
111
+ CA, # Type: correspondence analysis
112
+ MCA, # Type: multiple correspondence analysis
113
+ ca, # fit and return a correspondence analysis
114
+ mca, # fit and return a multiple correspondence analysis
115
+ objectscores, # return the object scores or coordinates from CA or MCA
116
+ variablescores, # return the variable/category scores or coordinates from CA or MCA
117
+ inertia # return the inertia (derived from eigenvalues) for CA
118
+
119
+ # # source files
120
+ include (" types.jl" )
121
+ include (" common.jl" )
122
+ include (" lreg.jl" )
123
+ include (" whiten.jl" )
124
+ include (" pca.jl" )
125
+ include (" ppca.jl" )
126
+ include (" kpca.jl" )
127
+ include (" cca.jl" )
128
+ include (" cmds.jl" )
129
+ include (" mmds.jl" )
130
+ include (" lda.jl" )
131
+ include (" ica.jl" )
132
+ include (" fa.jl" )
133
+ include (" mca.jl" )
134
+
135
+ # # deprecations
136
+ @deprecate indim (f) size (f, 1 )
137
+ @deprecate outdim (f) size (f, 2 )
138
+ @deprecate transform (f, x) predict (f, x)
139
+ @deprecate indim (f:: Whitening ) length (f:: Whitening )
140
+ @deprecate outdim (f:: Whitening ) length (f:: Whitening )
141
+ @deprecate tvar (f:: PCA ) var (f:: PCA )
142
+ @deprecate classical_mds (D:: AbstractMatrix , p:: Int ) predict (
143
+ fit (MDS, D, maxoutdim = p, distances = true ),
144
+ )
145
+ @deprecate transform (f:: MDS ) predict (f:: MDS )
146
+ @deprecate xindim (M:: CCA ) size (M, 1 )
147
+ @deprecate yindim (M:: CCA ) size (M, 2 )
148
+ @deprecate outdim (M:: CCA ) size (M, 3 )
149
+ @deprecate correlations (M:: CCA ) cor (M)
150
+ @deprecate xmean (M:: CCA ) mean (M, :x )
151
+ @deprecate ymean (M:: CCA ) mean (M, :y )
152
+ @deprecate xprojection (M:: CCA ) projection (M, :x )
153
+ @deprecate yprojection (M:: CCA ) projection (M, :y )
154
+ @deprecate xtransform (M:: CCA , x) predict (M, x, :x )
155
+ @deprecate ytransform (M:: CCA , y) predict (M, y, :y )
157
156
158
157
end # module
0 commit comments