(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 34696, 1067] NotebookOptionsPosition[ 31134, 937] NotebookOutlinePosition[ 31681, 958] CellTagsIndexPosition[ 31638, 955] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["M\[EAcute]todo da m\[AAcute]xima verossimilhan\ \[CCedilla]a", "Title"]], "Subtitle", CellChangeTimes->{{3.587745756234865*^9, 3.5877457759396296`*^9}, { 3.6198048158957343`*^9, 3.6198048202241716`*^9}, {3.668844284125103*^9, 3.668844287926095*^9}}], Cell["Vito, 5/4/2016", "Text", CellChangeTimes->{{3.668844298122126*^9, 3.6688443035687666`*^9}}], Cell[CellGroupData[{ Cell["logL for a homoscedastic dataset \[Distributed] normally", "Section", CellChangeTimes->{{3.668844322856862*^9, 3.6688443852994084`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"logL", "[", RowBox[{"dataset_", ",", "x_", ",", "\[Sigma]_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"Length", "[", "dataset", "]"}]}], RowBox[{"Log", "[", "\[Sigma]", "]"}]}], "-", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"x", "-", RowBox[{"dataset", "[", RowBox[{"[", "i", "]"}], "]"}]}], ")"}], "/", "\[Sigma]"}], ")"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "dataset", "]"}]}], "}"}]}], "]"}], "/", "2"}]}]}]], "Input", CellChangeTimes->{{3.6688444153329363`*^9, 3.6688445252524*^9}, { 3.668844720560193*^9, 3.6688447395900803`*^9}, 3.668845593157754*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"r", ";", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"xm", ",", "s", ",", "data"}], "}"}], ",", RowBox[{ RowBox[{"data", "=", RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"20", ",", "3"}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"xm", "=", RowBox[{"Mean", "[", "data", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"s", "=", " ", RowBox[{"Sqrt", "[", " ", RowBox[{"CentralMoment", "[", RowBox[{"data", ",", "2"}], "]"}], " ", "]"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{ "Variance", " ", "is", " ", "not", " ", "the", " ", "Maximum", " ", "Likelihood", " ", "estimate"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"ContourPlot", "[", " ", RowBox[{ RowBox[{"logL", "[", RowBox[{"data", ",", "x", ",", "\[Sigma]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Sigma]", ",", "0.5", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "10", ",", "30"}], "}"}], ",", RowBox[{"Contours", "\[Rule]", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"logL", "[", RowBox[{"data", ",", "xm", ",", "s"}], "]"}], "-", RowBox[{"i", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "7"}], "}"}]}], "]"}]}], " ", ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\[Sigma]", ",", "x"}], "}"}]}], ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "Large", "]"}], ",", "Black", ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"3", ",", "20"}], "}"}], "]"}], ",", "Red", ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"s", ",", "xm"}], "}"}], "]"}]}], " ", "}"}]}]}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "10"}], "}"}], ",", "2", ",", "50", ",", "1"}], "}"}], ",", "Delimiter", ",", RowBox[{"Row", "[", RowBox[{"{", RowBox[{"Button", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"r", "=", RowBox[{"RandomReal", "[", "]"}]}], "}"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"250", ",", "28"}], "}"}]}]}], "]"}], "}"}], "]"}], ",", RowBox[{"ControlPlacement", "\[Rule]", "Bottom"}]}], "]"}]], "Input", CellChangeTimes->{{3.668845149355384*^9, 3.6688452611590223`*^9}, { 3.668845315771064*^9, 3.6688453412915883`*^9}, {3.668845402967396*^9, 3.668845463098231*^9}, {3.668845535317233*^9, 3.66884553577123*^9}, { 3.6688461244054513`*^9, 3.6688461495847855`*^9}, {3.6688462836901197`*^9, 3.668846299079419*^9}, {3.668846330115554*^9, 3.668846330532118*^9}, { 3.6688463867663574`*^9, 3.668846389201256*^9}, {3.6688464714186573`*^9, 3.668846509210848*^9}, {3.668846556574086*^9, 3.668846558529374*^9}, { 3.66884700196461*^9, 3.6688470170701466`*^9}, {3.6688471619101973`*^9, 3.66884721487825*^9}, {3.6688472509196167`*^9, 3.668847289969363*^9}, { 3.6706588968818693`*^9, 3.6706589118590198`*^9}}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`n$$ = 50, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`n$$], 10}, 2, 50, 1}, { Hold[ Row[{ Button[ "Sort again", {$CellContext`r = RandomReal[]}, Appearance -> "Palette", ImageSize -> {250, 28}]}]], Manipulate`Dump`ThisIsNotAControl}}, Typeset`size$$ = { 576., {284., 291.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`n$909$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`n$$ = 10}, "ControllerVariables" :> { Hold[$CellContext`n$$, $CellContext`n$909$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> ($CellContext`r; Module[{$CellContext`xm$, $CellContext`s$, $CellContext`data$}, \ $CellContext`data$ = RandomVariate[ NormalDistribution[20, 3], $CellContext`n$$]; $CellContext`xm$ = Mean[$CellContext`data$]; $CellContext`s$ = Sqrt[ CentralMoment[$CellContext`data$, 2]]; ContourPlot[ $CellContext`logL[$CellContext`data$, $CellContext`x, \ $CellContext`\[Sigma]], {$CellContext`\[Sigma], 0.5, 6}, {$CellContext`x, 10, 30}, Contours -> Table[$CellContext`logL[$CellContext`data$, $CellContext`xm$, \ $CellContext`s$] - $CellContext`i^2, {$CellContext`i, 7}], FrameLabel -> {$CellContext`\[Sigma], $CellContext`x}, Epilog -> { PointSize[Large], Black, Point[{3, 20}], Red, Point[{$CellContext`s$, $CellContext`xm$}]}]]), "Specifications" :> {{{$CellContext`n$$, 10}, 2, 50, 1}, Delimiter, Row[{ Button[ "Sort again", {$CellContext`r = RandomReal[]}, Appearance -> "Palette", ImageSize -> {250, 28}]}]}, "Options" :> {ControlPlacement -> Bottom}, "DefaultOptions" :> {}], ImageSizeCache->{650., {389., 398.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$}, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{ 3.668845472439034*^9, 3.6688455371722827`*^9, 3.668845599473068*^9, 3.6688461520293055`*^9, {3.6688463134059997`*^9, 3.6688463322657433`*^9}, 3.668846392003112*^9, 3.6688465222436895`*^9, 3.6688465593637753`*^9, 3.6688470178321466`*^9, 3.6688472299859896`*^9, {3.6688472793555174`*^9, 3.668847290523424*^9}, 3.6706589343200126`*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["M\[EAcute]dia de dois dados a(\[Sigma]a) e \ b(\[Sigma]b) com correla\[CCedilla]\[ATilde]o \[Rho], com f.d.p. binormal", \ "Subtitle"]], "Subsubtitle", CellChangeTimes->{{3.5877445834187813`*^9, 3.5877445930133295`*^9}, { 3.587744748197896*^9, 3.5877447844665394`*^9}, {3.587744854003573*^9, 3.58774486178547*^9}}], Cell[TextData[StyleBox["matriz de vari\[AHat]ncias", "Subsection"]], "Text", CellChangeTimes->{{3.5877447951080494`*^9, 3.5877448006866384`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"v", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]a", "^", "2"}], ",", RowBox[{"\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], ",", " ", RowBox[{"\[Sigma]b", "^", "2"}]}], "}"}]}], "}"}]}], ";", RowBox[{"MatrixForm", "[", "v", "]"}]}]], "Input", CellChangeTimes->{{3.5877443076145916`*^9, 3.5877443562123833`*^9}, { 3.6688473675550675`*^9, 3.6688473759570875`*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ { SuperscriptBox["\[Sigma]a", "2"], RowBox[{"\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}]}, { RowBox[{"\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], SuperscriptBox["\[Sigma]b", "2"]} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.619805229849022*^9, 3.619805699957058*^9, {3.6688473634529066`*^9, 3.6688473766570807`*^9}, 3.670658987235079*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"MatrixForm", "[", RowBox[{"Inverse", "[", "v", "]"}], " ", "]"}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.5877443858398485`*^9, 3.587744403497566*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ { FractionBox["1", RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{ SuperscriptBox["\[Rho]", "2"], " ", SuperscriptBox["\[Sigma]a", "2"]}]}]], RowBox[{"-", FractionBox["\[Rho]", RowBox[{ RowBox[{"\[Sigma]a", " ", "\[Sigma]b"}], "-", RowBox[{ SuperscriptBox["\[Rho]", "2"], " ", "\[Sigma]a", " ", "\[Sigma]b"}]}]]}]}, { RowBox[{"-", FractionBox["\[Rho]", RowBox[{ RowBox[{"\[Sigma]a", " ", "\[Sigma]b"}], "-", RowBox[{ SuperscriptBox["\[Rho]", "2"], " ", "\[Sigma]a", " ", "\[Sigma]b"}]}]]}], FractionBox["1", RowBox[{ SuperscriptBox["\[Sigma]b", "2"], "-", RowBox[{ SuperscriptBox["\[Rho]", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}]}]]} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.6198052300052834`*^9, 3.6198057000195622`*^9, 3.6688473902797213`*^9, 3.670658987350978*^9}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["vetor de diferen\[CCedilla]as em rela\[CCedilla]\ \[ATilde]o ao valor verdadeiro e expoente da binormal", "Subsection"]], \ "Subsubsection", CellChangeTimes->{{3.5877448348926086`*^9, 3.587744849784472*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"dx", "=", RowBox[{"{", RowBox[{ RowBox[{"a", "-", "x"}], ",", RowBox[{"b", "-", "x"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.5877444138109255`*^9, 3.5877444205146065`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"a", "-", "x"}], ",", RowBox[{"b", "-", "x"}]}], "}"}]], "Output", CellChangeTimes->{3.6198052300052834`*^9, 3.6198057000351887`*^9, 3.6688473998017898`*^9, 3.670658987366602*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"q", "=", RowBox[{ RowBox[{ RowBox[{"dx", ".", RowBox[{"Inverse", "[", "v", "]"}], ".", "dx"}], "/", "2"}], "//", "Simplify"}]}]], "Input", CellChangeTimes->{{3.587744424280545*^9, 3.5877444509858913`*^9}}], Cell[BoxData[ RowBox[{"-", FractionBox[ RowBox[{ RowBox[{ SuperscriptBox["b", "2"], " ", SuperscriptBox["\[Sigma]a", "2"]}], "+", RowBox[{"2", " ", "a", " ", "x", " ", RowBox[{"(", RowBox[{ RowBox[{"\[Rho]", " ", "\[Sigma]a"}], "-", "\[Sigma]b"}], ")"}], " ", "\[Sigma]b"}], "+", RowBox[{ SuperscriptBox["a", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}], "+", RowBox[{ SuperscriptBox["x", "2"], " ", RowBox[{"(", RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}], ")"}]}], "-", RowBox[{"2", " ", "b", " ", "\[Sigma]a", " ", RowBox[{"(", RowBox[{ RowBox[{"a", " ", "\[Rho]", " ", "\[Sigma]b"}], "+", RowBox[{"x", " ", RowBox[{"(", RowBox[{"\[Sigma]a", "-", RowBox[{"\[Rho]", " ", "\[Sigma]b"}]}], ")"}]}]}], ")"}]}]}], RowBox[{"2", " ", RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "+", SuperscriptBox["\[Rho]", "2"]}], ")"}], " ", SuperscriptBox["\[Sigma]a", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}]]}]], "Output", CellChangeTimes->{3.6198052300365353`*^9, 3.6198057000664396`*^9, 3.668847405995327*^9, 3.6706589874043665`*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Estimativa de m\[AAcute]xima \ verossimilhan\[CCedilla]a", "Section"]], "Subsubsection", CellChangeTimes->{{3.58774488252157*^9, 3.5877448989135585`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"D", "[", RowBox[{"q", ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.587744458502141*^9, 3.5877444614711385`*^9}}], Cell[BoxData[ RowBox[{"-", FractionBox[ RowBox[{ RowBox[{"2", " ", "a", " ", RowBox[{"(", RowBox[{ RowBox[{"\[Rho]", " ", "\[Sigma]a"}], "-", "\[Sigma]b"}], ")"}], " ", "\[Sigma]b"}], "-", RowBox[{"2", " ", "b", " ", "\[Sigma]a", " ", RowBox[{"(", RowBox[{"\[Sigma]a", "-", RowBox[{"\[Rho]", " ", "\[Sigma]b"}]}], ")"}]}], "+", RowBox[{"2", " ", "x", " ", RowBox[{"(", RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}], ")"}]}]}], RowBox[{"2", " ", RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "+", SuperscriptBox["\[Rho]", "2"]}], ")"}], " ", SuperscriptBox["\[Sigma]a", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}]]}]], "Output", CellChangeTimes->{3.6198052300365353`*^9, 3.6198057000664396`*^9, 3.668847412211452*^9, 3.6706589874043665`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"sol", "=", RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"D", "[", RowBox[{"q", ",", "x"}], "]"}], "\[Equal]", "0"}], ",", "x"}], "]"}], "//", "Simplify"}]}]], "Input", CellChangeTimes->{{3.5877444675497684`*^9, 3.5877444996618147`*^9}, { 3.668847434546934*^9, 3.6688474362336454`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{"x", "\[Rule]", FractionBox[ RowBox[{ RowBox[{"a", " ", "\[Sigma]b", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"-", "\[Rho]"}], " ", "\[Sigma]a"}], "+", "\[Sigma]b"}], ")"}]}], "+", RowBox[{"b", " ", "\[Sigma]a", " ", RowBox[{"(", RowBox[{"\[Sigma]a", "-", RowBox[{"\[Rho]", " ", "\[Sigma]b"}]}], ")"}]}]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]]}], "}"}], "}"}]], "Output", CellChangeTimes->{ 3.619805230052161*^9, 3.619805700082066*^9, {3.66884741747873*^9, 3.6688474370126295`*^9}, 3.6706589874356174`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"xest", "=", RowBox[{"x", "/.", RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.5877445277579017`*^9, 3.587744555807106*^9}, { 3.6688474400373*^9, 3.6688474528611317`*^9}}], Cell[BoxData[ FractionBox[ RowBox[{ RowBox[{"a", " ", "\[Sigma]b", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"-", "\[Rho]"}], " ", "\[Sigma]a"}], "+", "\[Sigma]b"}], ")"}]}], "+", RowBox[{"b", " ", "\[Sigma]a", " ", RowBox[{"(", RowBox[{"\[Sigma]a", "-", RowBox[{"\[Rho]", " ", "\[Sigma]b"}]}], ")"}]}]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]]], "Output", CellChangeTimes->{ 3.6198052300677876`*^9, 3.619805700082066*^9, {3.6688474272889843`*^9, 3.668847453477556*^9}, 3.670658987451245*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["vari\[AHat]ncia da estimativa", "Subsection"]], \ "Subsubsection", CellChangeTimes->{{3.587745414128286*^9, 3.5877454318172536`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", "=", RowBox[{"{", RowBox[{ RowBox[{"D", "[", RowBox[{"xest", ",", "a"}], "]"}], ",", RowBox[{"D", "[", RowBox[{"xest", ",", "b"}], "]"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.587745435723832*^9, 3.5877454794305925`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"\[Sigma]b", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"-", "\[Rho]"}], " ", "\[Sigma]a"}], "+", "\[Sigma]b"}], ")"}]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]], ",", FractionBox[ RowBox[{"\[Sigma]a", " ", RowBox[{"(", RowBox[{"\[Sigma]a", "-", RowBox[{"\[Rho]", " ", "\[Sigma]b"}]}], ")"}]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]]}], "}"}]], "Output", CellChangeTimes->{3.6198052300677876`*^9, 3.6198057000976915`*^9, 3.6688474724766064`*^9, 3.670658987451245*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"varx", "=", RowBox[{ RowBox[{"f", ".", "v", ".", "f"}], "//", "Simplify"}]}]], "Input", CellChangeTimes->{{3.58774548475916*^9, 3.587745518683857*^9}}], Cell[BoxData[ RowBox[{"-", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "+", SuperscriptBox["\[Rho]", "2"]}], ")"}], " ", SuperscriptBox["\[Sigma]a", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]]}]], "Output", CellChangeTimes->{3.6198052300677876`*^9, 3.6198057001133184`*^9, 3.6688474755810223`*^9, 3.6706589874668694`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"estim", "=", RowBox[{"{", RowBox[{"xest", ",", "varx"}], "}"}]}]], "Input", CellChangeTimes->{{3.587745531153644*^9, 3.5877455432015204`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{ RowBox[{"a", " ", "\[Sigma]b", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"-", "\[Rho]"}], " ", "\[Sigma]a"}], "+", "\[Sigma]b"}], ")"}]}], "+", RowBox[{"b", " ", "\[Sigma]a", " ", RowBox[{"(", RowBox[{"\[Sigma]a", "-", RowBox[{"\[Rho]", " ", "\[Sigma]b"}]}], ")"}]}]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]], ",", RowBox[{"-", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "+", SuperscriptBox["\[Rho]", "2"]}], ")"}], " ", SuperscriptBox["\[Sigma]a", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "-", RowBox[{"2", " ", "\[Rho]", " ", "\[Sigma]a", " ", "\[Sigma]b"}], "+", SuperscriptBox["\[Sigma]b", "2"]}]]}]}], "}"}]], "Output", CellChangeTimes->{3.6198052300677876`*^9, 3.6198057001133184`*^9, 3.668847479987671*^9, 3.6706589874668694`*^9}] }, Open ]] }, Open ]], Cell[TextData[StyleBox["Casos particulares", "Subsection"]], "Subsubsection", CellChangeTimes->{{3.587744942589066*^9, 3.587744970841416*^9}}], Cell[CellGroupData[{ Cell["vari\[AHat]ncias iguais", "Subsubsection", CellChangeTimes->{{3.587745320136093*^9, 3.587745326402239*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"\[Sigma]a", "\[Rule]", "\[Sigma]b"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.5877449767012787`*^9, 3.587745004734859*^9}, { 3.587745549905204*^9, 3.587745552139764*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"a", "+", "b"}], "2"], ",", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"1", "+", "\[Rho]"}], ")"}], " ", SuperscriptBox["\[Sigma]b", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230083414*^9, 3.6198057001133184`*^9, 3.668847491560393*^9, 3.6706589874870033`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"estim", "/.", RowBox[{"\[Rho]", "\[Rule]", "0"}]}]], "Input", CellChangeTimes->{{3.5877450161889377`*^9, 3.587745025439707*^9}, { 3.587745562328112*^9, 3.587745564375157*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{ RowBox[{"b", " ", SuperscriptBox["\[Sigma]a", "2"]}], "+", RowBox[{"a", " ", SuperscriptBox["\[Sigma]b", "2"]}]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "+", SuperscriptBox["\[Sigma]b", "2"]}]], ",", FractionBox[ RowBox[{ SuperscriptBox["\[Sigma]a", "2"], " ", SuperscriptBox["\[Sigma]b", "2"]}], RowBox[{ SuperscriptBox["\[Sigma]a", "2"], "+", SuperscriptBox["\[Sigma]b", "2"]}]]}], "}"}]], "Output", CellChangeTimes->{3.619805230083414*^9, 3.6198057001289454`*^9, 3.668847497065271*^9, 3.6706589874885044`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"%", "/.", RowBox[{"\[Sigma]a", "\[Rule]", "\[Sigma]b"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.5877450532388945`*^9, 3.5877450836945524`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"a", "+", "b"}], "2"], ",", FractionBox[ SuperscriptBox["\[Sigma]b", "2"], "2"]}], "}"}]], "Output", CellChangeTimes->{3.619805230083414*^9, 3.6198057001289454`*^9, 3.6688475028732824`*^9, 3.6706589874885044`*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["vari\[AHat]ncias diferentes", "Subsection", CellChangeTimes->{{3.5877453361061716`*^9, 3.587745339434573*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}]}], "//", "Simplify", " ", RowBox[{"(*", " ", RowBox[{ RowBox[{"no", " ", "resultado"}], ",", " ", RowBox[{ "note", " ", "que", " ", "tanto", " ", "o", " ", "numerador", " ", "quanto", " ", "o", " ", "denominador", " ", "da", " ", "vari\[AHat]ncia", " ", "da", " ", "estimativa", " ", "s\[ATilde]o", " ", "negativos"}], ",", " ", RowBox[{"ou", " ", "seja"}], ",", " ", RowBox[{ RowBox[{"a", " ", "vari\[AHat]ncia", " ", "\[EAcute]", " ", "semi"}], "-", RowBox[{"definida", " ", "positiva"}]}]}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.587745127651334*^9, 3.5877451562318344`*^9}, { 3.587745586298856*^9, 3.5877455901116734`*^9}, {3.5877456235050755`*^9, 3.5877456820568204`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"a", "+", RowBox[{"4", " ", "b"}], "-", RowBox[{"2", " ", "a", " ", "\[Rho]"}], "-", RowBox[{"2", " ", "b", " ", "\[Rho]"}]}], RowBox[{"5", "-", RowBox[{"4", " ", "\[Rho]"}]}]], ",", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "+", SuperscriptBox["\[Rho]", "2"]}], ")"}], " ", SuperscriptBox["\[Sigma]a", "2"]}], RowBox[{ RowBox[{"-", "5"}], "+", RowBox[{"4", " ", "\[Rho]"}]}]]}], "}"}]], "Output", CellChangeTimes->{3.6198052300990396`*^9, 3.6198057001445713`*^9, 3.668847526619629*^9, 3.670658987519822*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}], ",", RowBox[{"\[Rho]", "\[Rule]", "0.9"}]}], "}"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.587745177327341*^9, 3.587745208814334*^9}, { 3.587745246379958*^9, 3.587745262240653*^9}, {3.58774568776042*^9, 3.5877456898074646`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", "0.5714285714285715`"}], " ", "a"}], "+", RowBox[{"1.5714285714285716`", " ", "b"}]}], ",", RowBox[{"0.13571428571428568`", " ", SuperscriptBox["\[Sigma]a", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230114666*^9, 3.6198057001445713`*^9, 3.6688475350733147`*^9, 3.670658987535448*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}], ",", RowBox[{"\[Rho]", "\[Rule]", "0.5"}]}], "}"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.5877453477790174`*^9, 3.587745348216552*^9}, { 3.587745695104781*^9, 3.5877456970580673`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"0.`", "\[VeryThinSpace]", "+", RowBox[{"1.`", " ", "b"}]}], ",", RowBox[{"0.25`", " ", SuperscriptBox["\[Sigma]a", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230114666*^9, 3.6198057001601973`*^9, 3.668847548618591*^9, 3.670658987535448*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}], ",", RowBox[{"\[Rho]", "\[Rule]", "0.1"}]}], "}"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.587745358623669*^9, 3.5877453589674478`*^9}, { 3.587745703886761*^9, 3.587745705574401*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"0.1739130434782609`", " ", "a"}], "+", RowBox[{"0.8260869565217391`", " ", "b"}]}], ",", RowBox[{"0.21521739130434783`", " ", SuperscriptBox["\[Sigma]a", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230114666*^9, 3.6198057001601973`*^9, 3.668847554106001*^9, 3.6706589875510807`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}], ",", RowBox[{"\[Rho]", "\[Rule]", RowBox[{"-", "0.1"}]}]}], "}"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.587745364921068*^9, 3.5877453682494698`*^9}, { 3.587745707793336*^9, 3.5877457095122285`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"0.2222222222222222`", " ", "a"}], "+", RowBox[{"0.7777777777777778`", " ", "b"}]}], ",", RowBox[{"0.18333333333333332`", " ", SuperscriptBox["\[Sigma]a", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230114666*^9, 3.6198057001601973`*^9, 3.6688475604297047`*^9, 3.6706589875510807`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}], ",", RowBox[{"\[Rho]", "\[Rule]", RowBox[{"-", "0.5"}]}]}], "}"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.5877453765314083`*^9, 3.5877453769689455`*^9}, { 3.587745713575067*^9, 3.587745715450224*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"0.2857142857142857`", " ", "a"}], "+", RowBox[{"0.7142857142857142`", " ", "b"}]}], ",", RowBox[{"0.10714285714285714`", " ", SuperscriptBox["\[Sigma]a", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230130292*^9, 3.6198057001601973`*^9, 3.6688475644818797`*^9, 3.670658987566699*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"estim", "/.", RowBox[{"{", RowBox[{ RowBox[{"\[Sigma]b", "\[Rule]", RowBox[{"\[Sigma]a", "/", "2"}]}], ",", RowBox[{"\[Rho]", "\[Rule]", RowBox[{"-", "0.9"}]}]}], "}"}]}], "//", "Simplify"}]], "Input", CellChangeTimes->{{3.587745381828725*^9, 3.5877453822350082`*^9}, { 3.587745719856839*^9, 3.587745721857006*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"0.3255813953488372`", " ", "a"}], "+", RowBox[{"0.6744186046511628`", " ", "b"}]}], ",", RowBox[{"0.022093023255813946`", " ", SuperscriptBox["\[Sigma]a", "2"]}]}], "}"}]], "Output", CellChangeTimes->{3.619805230130292*^9, 3.6198057001758227`*^9, 3.668847568653894*^9, 3.670658987566699*^9}] }, Open ]] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{1480, 895}, WindowMargins->{{-5, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{32000, 32000}, PrintingOptions->{"Magnification"->1., "PaperOrientation"->"Portrait", "PaperSize"->{595.1999999999999, 841.68}}, Magnification->1.6000001430511475`, FrontEndVersion->"10.4 for Microsoft Windows (64-bit) (April 11, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 279, 4, 132, "Subtitle"], Cell[861, 28, 98, 1, 47, "Text"], Cell[CellGroupData[{ Cell[984, 33, 143, 1, 112, "Section"], Cell[1130, 36, 837, 25, 77, "Input"], Cell[CellGroupData[{ Cell[1992, 65, 3585, 82, 309, "Input"], Cell[5580, 149, 3131, 62, 813, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[8760, 217, 344, 5, 68, "Subsubtitle"], Cell[9107, 224, 146, 1, 67, "Text"], Cell[CellGroupData[{ Cell[9278, 229, 582, 15, 47, "Input"], Cell[9863, 246, 916, 24, 96, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10816, 275, 205, 5, 47, "Input"], Cell[11024, 282, 1556, 45, 116, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12617, 332, 232, 3, 64, "Subsubsection"], Cell[CellGroupData[{ Cell[12874, 339, 217, 6, 47, "Input"], Cell[13094, 347, 238, 6, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13369, 358, 250, 7, 47, "Input"], Cell[13622, 367, 1354, 38, 77, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[15025, 411, 179, 2, 82, "Subsubsection"], Cell[CellGroupData[{ Cell[15229, 417, 145, 3, 47, "Input"], Cell[15377, 422, 992, 27, 77, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16406, 454, 358, 10, 47, "Input"], Cell[16767, 466, 811, 22, 73, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17615, 493, 249, 6, 47, "Input"], Cell[17867, 501, 689, 19, 73, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[18605, 526, 158, 2, 64, "Subsubsection"], Cell[CellGroupData[{ Cell[18788, 532, 282, 8, 47, "Input"], Cell[19073, 542, 879, 24, 73, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19989, 571, 182, 4, 47, "Input"], Cell[20174, 577, 561, 15, 76, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[20772, 597, 174, 4, 47, "Input"], Cell[20949, 603, 1180, 33, 76, "Output"] }, Open ]] }, Open ]], Cell[22156, 640, 143, 1, 64, "Subsubsection"], Cell[CellGroupData[{ Cell[22324, 645, 114, 1, 49, "Subsubsection"], Cell[CellGroupData[{ Cell[22463, 650, 251, 6, 47, "Input"], Cell[22717, 658, 382, 11, 67, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[23136, 674, 205, 4, 47, "Input"], Cell[23344, 680, 666, 20, 73, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24047, 705, 200, 5, 47, "Input"], Cell[24250, 712, 293, 8, 71, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[24592, 726, 117, 1, 77, "Subsection"], Cell[CellGroupData[{ Cell[24734, 731, 880, 20, 106, "Input"], Cell[25617, 753, 688, 21, 73, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26342, 779, 416, 11, 47, "Input"], Cell[26761, 792, 396, 10, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27194, 807, 370, 10, 47, "Input"], Cell[27567, 819, 321, 8, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27925, 832, 368, 10, 47, "Input"], Cell[28296, 844, 375, 9, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28708, 858, 389, 10, 47, "Input"], Cell[29100, 870, 377, 9, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[29514, 884, 389, 10, 47, "Input"], Cell[29906, 896, 375, 9, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[30318, 910, 387, 10, 47, "Input"], Cell[30708, 922, 374, 9, 54, "Output"] }, Open ]] }, Open ]] }, Open ]] }, Open ]] } ] *)