(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 8060, 243] NotebookOptionsPosition[ 7540, 226] NotebookOutlinePosition[ 7881, 241] CellTagsIndexPosition[ 7838, 238] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Mahalanobis fuzzy Calinski\[Dash]Harabasz index", FontColor->RGBColor[1, 0, 0]]], "Subsection", CellChangeTimes->{ 3.5854097085807176`*^9, 3.585637218737363*^9, {3.7255165931679688`*^9, 3.725516594386836*^9}, {3.8078509217486286`*^9, 3.8078509235303373`*^9}, 3.822225222190958*^9, 3.8222263491864443`*^9, 3.8222269369146223`*^9, 3.8222271612780204`*^9, 3.8222276850838566`*^9},ExpressionUUID->"a64cb8e3-4b5a-458a-81b2-\ 359028b304d5"], Cell[BoxData[{ RowBox[{ RowBox[{ StyleBox["Input", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"data", " ", "set", " ", "\[ScriptCapitalA]"}], " ", "\[Subset]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"centers", " ", SubscriptBox["z", "1"]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["\[TripleDot]", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ SubscriptBox["z", "k"], " ", "\[Element]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"membership", " ", "matrix", " ", "U"}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"covariance", " ", "matrices", " ", UnderscriptBox["\[Sum]", "j"]}], "\[Element]", SuperscriptBox["\[DoubleStruckCapitalR]", RowBox[{"n", "\[Cross]", "n"}]]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"j", "=", "1"}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["\[TripleDot]", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"k", ";"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"MFCH", " ", "index"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[";", FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"dM", "[", "]"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]"}], "Text", CellChangeTimes->{{3.8208938752340946`*^9, 3.8208939165097227`*^9}, 3.8208939777537127`*^9, {3.82089402908541*^9, 3.8208940654953437`*^9}, { 3.820894178610306*^9, 3.8208942451936073`*^9}, {3.820894336841039*^9, 3.8208943606992674`*^9}, {3.8222252468201857`*^9, 3.8222252579121275`*^9}, {3.8222263768275585`*^9, 3.8222264735149126`*^9}, {3.8222267120062532`*^9, 3.8222267137917337`*^9}, 3.8222268123848886`*^9, {3.8222269734939747`*^9, 3.8222270468006*^9}, { 3.822227188241254*^9, 3.8222272187064533`*^9}, {3.822227276564354*^9, 3.822227297837488*^9}, 3.8222277085849485`*^9, {3.8223124944875007`*^9, 3.8223125118386803`*^9}, 3.82231254575541*^9, {3.824708881532322*^9, 3.8247088841518707`*^9}}, FontSize->12,ExpressionUUID->"46567b81-f70d-49a0-a082-b32f5d905c2d"], Cell[BoxData[{ RowBox[{"Clear", "[", "MFCH", "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"MFCH", "[", RowBox[{"A_", ",", "cen_", ",", "U_", ",", "cov_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"m", ",", "k"}], "}"}], ",", RowBox[{ RowBox[{"m", "=", RowBox[{"Length", "[", "A", "]"}]}], ";", RowBox[{"k", "=", RowBox[{"Length", "[", "cen", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"cc", "=", RowBox[{"Mean", "[", "A", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"covcc", "=", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"KroneckerProduct", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "-", "cc"}], ")"}], ",", RowBox[{"(", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "-", "cc"}], ")"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}]}], "]"}], "/", "m"}]}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", RowBox[{"ii", ",", "j"}], "]"}], "]"}], "^", "q"}], ",", RowBox[{"{", RowBox[{"ii", ",", "m"}], "}"}]}], "]"}], " ", "*", RowBox[{"dM", "[", RowBox[{"cc", ",", RowBox[{"cen", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{ RowBox[{"cov", "[", RowBox[{"[", "j", "]"}], "]"}], "+", "covcc"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}], "/", RowBox[{"(", RowBox[{"k", "-", "1"}], ")"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "^", "q"}], " ", RowBox[{"dM", "[", RowBox[{ RowBox[{"cen", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"cov", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}], "/", RowBox[{"(", RowBox[{"m", "-", "k"}], ")"}]}], ")"}]}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}]}], "Input", CellChangeTimes->{{3.8247088979245768`*^9, 3.8247089026351876`*^9}},ExpressionUUID->"0e41eddc-6da5-4c4d-9678-\ a3283ea04565"] }, Open ]] }, WindowSize->{795, 779}, WindowMargins->{{-8, Automatic}, {Automatic, 0}}, FrontEndVersion->"12.0 for Microsoft Windows (64-bit) (April 8, 2019)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 479, 8, 53, "Subsection",ExpressionUUID->"a64cb8e3-4b5a-458a-81b2-359028b304d5"], Cell[1062, 32, 3366, 102, 126, "Text",ExpressionUUID->"46567b81-f70d-49a0-a082-b32f5d905c2d"], Cell[4431, 136, 3093, 87, 143, "Input",ExpressionUUID->"0e41eddc-6da5-4c4d-9678-a3283ea04565"] }, Open ]] } ] *)