(* 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[ 8350, 245] NotebookOptionsPosition[ 7989, 228] NotebookOutlinePosition[ 8337, 243] CellTagsIndexPosition[ 8294, 240] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Mahalanobis fuzzy Davies-Bouldin 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, 3.822227789407708*^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[{ RowBox[{"j", "=", RowBox[{"1", "\[TripleDot]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[{"MFDB", " ", "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.8222278404812093`*^9, 3.822227840804907*^9}, {3.8223127693009033`*^9, 3.822312779545064*^9}, 3.8223128178382854`*^9}, FontSize->12, ExpressionUUID -> "46567b81-f70d-49a0-a082-b32f5d905c2d"], Cell[BoxData[{ RowBox[{"Clear", "[", "MFDB", "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"MFDB", "[", RowBox[{"A_", ",", "cen_", ",", "U_", ",", "cov_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"m", "=", RowBox[{"Length", "[", "A", "]"}]}], ",", RowBox[{"k", "=", RowBox[{"Length", "[", "cen", "]"}]}], ",", "VV", ",", "max", ",", RowBox[{"sum", "=", "0"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"VV", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"VV", "[", RowBox[{"[", "j", "]"}], "]"}], "=", 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[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "^", "q"}], ",", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}]}], "]"}]}]}], "\[IndentingNewLine]", " ", ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"max", "=", RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"i", "\[NotEqual]", "j"}], ",", RowBox[{"max", "=", RowBox[{"Append", "[", RowBox[{"max", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"VV", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"VV", "[", RowBox[{"[", "j", "]"}], "]"}]}], ")"}], "/", RowBox[{"dM", "[", RowBox[{ RowBox[{"cen", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"cen", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{ RowBox[{"cov", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"cov", "[", RowBox[{"[", "j", "]"}], "]"}]}]}], "]"}]}]}], " ", "]"}]}]}], "]"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"i", ",", "k"}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"sum", "=", RowBox[{"sum", "+", RowBox[{"Max", "[", "max", "]"}]}]}]}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"sum", "/", "k"}]}]}], "\[IndentingNewLine]", " ", "]"}]}]}], "Input",ExpressionUUID->"1d014ae5-121a-4f74-b98a-0da8960927c6"] }, Open ]] }, WindowSize->{1536, 779}, WindowMargins->{{-8, Automatic}, {Automatic, -8}}, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 490, 7, 49, "Subsection"], Cell[1073, 31, 3190, 96, 106, "Text"], Cell[4266, 129, 3707, 96, 297, "Input"] }, Open ]] } ] *)