(* 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[ 6417, 198] NotebookOptionsPosition[ 6057, 181] NotebookOutlinePosition[ 6405, 196] CellTagsIndexPosition[ 6362, 193] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Membership function for Mahalanobis fuzzy clustering ", FontColor->RGBColor[1, 0, 0]]], "Subsection", CellChangeTimes->{{3.8084618714088645`*^9, 3.8084618908237944`*^9}, { 3.8084620398710685`*^9, 3.8084620412028494`*^9}, 3.810605251348341*^9, 3.820893434746417*^9, 3.820893623244592*^9}, ExpressionUUID -> "93caaf48-8384-4b2f-b497-8fecdb25fd42"], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ 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["c", "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["c", "k"], " ", "\[Element]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"covariance", " ", "matrices", " ", UnderscriptBox["\[Sum]", "t"]}], "\[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[{"t", "=", RowBox[{"1", "\[TripleDot]k"}]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"indexes", " ", "i"}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"j", ";"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"membership", " ", "function", " ", SubscriptBox["u", "ij"]}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[";", FontColor->RGBColor[0, 0, 1]]}], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], 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]]}], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]]}]}]], "Text", CellChangeTimes->{{3.820893557297995*^9, 3.820893602606736*^9}, { 3.820895027894353*^9, 3.820895029852955*^9}, {3.8223142472435074`*^9, 3.822314254097814*^9}, 3.8223142976703205`*^9}, FontSize->12, ExpressionUUID -> "73ef3c6b-2a45-4a23-a550-7e063f9a429d"], Cell[BoxData[{ RowBox[{ RowBox[{"q", "=", "2"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"muGK", "[", RowBox[{"A_", ",", "cen_", ",", "Scov_", ",", "i_", ",", "j_"}], "]"}], ":=", RowBox[{"1", "/", RowBox[{"(", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"dM", "[", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"cen", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{"Scov", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], "/", RowBox[{"dM", "[", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"cen", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"Scov", "[", RowBox[{"[", "s", "]"}], "]"}]}], "]"}]}], ")"}], "^", RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"q", "-", "1"}], ")"}]}], ")"}]}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "cen", "]"}]}], "}"}]}], "]"}], ")"}]}]}]}], "Input", CellChangeTimes->{{3.724725833114142*^9, 3.724725843990486*^9}, { 3.724728635750023*^9, 3.724728637250459*^9}, {3.7259794061238146`*^9, 3.725979408013785*^9}, {3.8081978810729227`*^9, 3.8081979294141273`*^9}, { 3.8081979731292315`*^9, 3.808197985304242*^9}, {3.808198670049842*^9, 3.8081986774049206`*^9}, {3.808198887962269*^9, 3.8081989165562057`*^9}, 3.808198966488373*^9, {3.808223721910182*^9, 3.808223733523771*^9}, { 3.8084598330424356`*^9, 3.808459877353877*^9}, {3.808459930519123*^9, 3.8084599364557114`*^9}, {3.8084618955399303`*^9, 3.8084618961041512`*^9}, 3.808969777858821*^9, {3.8106052584840465`*^9, 3.810605259035054*^9}}, ExpressionUUID -> "e95968e7-d730-42d2-8468-ca54b484d0e2"] }, 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, 379, 5, 49, "Subsection"], Cell[962, 29, 3140, 101, 124, "Text"], Cell[4105, 132, 1936, 46, 50, "Input"] }, Open ]] } ] *)