(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 10.2' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 18084, 441] NotebookOptionsPosition[ 16916, 399] NotebookOutlinePosition[ 17323, 417] CellTagsIndexPosition[ 17280, 414] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell["MAP30#2", "Subsubsection", CellChangeTimes->{{3.728978072142015*^9, 3.728978078436468*^9}, { 3.7289787758916683`*^9, 3.728978777915042*^9}, {3.728979117073182*^9, 3.728979124168069*^9}, {3.72897937739428*^9, 3.7289793834544497`*^9}, { 3.728980621199177*^9, 3.728980659270624*^9}, {3.72898742841497*^9, 3.728987435586033*^9}, {3.887203586315774*^9, 3.8872035919214087`*^9}, { 3.889075926817493*^9, 3.889075926969419*^9}}], Cell[CellGroupData[{ Cell["Question 1 \[LongDash]\[NonBreakingSpace]Type II/item censoring with \ replacement", "Subsubsection", CellChangeTimes->{{3.728978072142015*^9, 3.728978078436468*^9}, { 3.7289787758916683`*^9, 3.728978777915042*^9}, {3.728979117073182*^9, 3.728979124168069*^9}, {3.72897937739428*^9, 3.7289793834544497`*^9}, { 3.728980621199177*^9, 3.728980659270624*^9}, {3.72898742841497*^9, 3.728987435586033*^9}, {3.8872035562635403`*^9, 3.887203571506999*^9}, { 3.889075948658783*^9, 3.889075948905105*^9}, {3.893068488938219*^9, 3.893068489604116*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"n", "=", "5"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ SubscriptBox["t", "0"], "=", "8760"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Tau]", "=", RowBox[{"n", "\[Times]", SubscriptBox["t", "0"]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"r", "=", "3"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[Alpha]", "=", "0.1"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"Quantile", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", RowBox[{"2", "*", "r"}], "]"}], ",", RowBox[{"\[Alpha]", "/", "2"}]}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Quantile", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", RowBox[{ RowBox[{"2", "*", "r"}], "+", "2"}], "]"}], ",", RowBox[{"1", "-", RowBox[{"\[Alpha]", "/", "2"}]}]}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ SubscriptBox["\[Lambda]", "L"], "=", RowBox[{ RowBox[{"Quantile", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", RowBox[{"2", "*", "r"}], "]"}], ",", RowBox[{"\[Alpha]", "/", "2"}]}], "]"}], "/", RowBox[{"(", RowBox[{"2", "*", "\[Tau]"}], ")"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ SubscriptBox["\[Lambda]", "U"], "=", RowBox[{ RowBox[{"Quantile", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", RowBox[{ RowBox[{"2", "*", "r"}], "+", "2"}], "]"}], ",", RowBox[{"1", "-", RowBox[{"\[Alpha]", "/", "2"}]}]}], "]"}], "/", RowBox[{"(", RowBox[{"2", "*", "\[Tau]"}], ")"}]}]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"1", "/", SubscriptBox["\[Lambda]", "U"]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"1", "/", SubscriptBox["\[Lambda]", "L"]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Using", " ", "the", " ", "tables"}], " ", "*)"}]}], "\[IndentingNewLine]", RowBox[{"1.635", "/", RowBox[{"(", RowBox[{"2", "\[Times]", "5", "\[Times]", "8760"}], ")"}]}], "\[IndentingNewLine]", RowBox[{"15.51", "/", RowBox[{"(", RowBox[{"2", "\[Times]", "5", "\[Times]", "8760"}], ")"}]}], "\[IndentingNewLine]", RowBox[{"1", "/", RowBox[{"(", RowBox[{"15.51", "/", RowBox[{"(", RowBox[{"2", "\[Times]", "5", "\[Times]", "8760"}], ")"}]}], ")"}]}], "\[IndentingNewLine]", RowBox[{"1", "/", RowBox[{"(", RowBox[{"1.635", "/", RowBox[{"(", RowBox[{"2", "\[Times]", "5", "\[Times]", "8760"}], ")"}]}], ")"}]}]}], "Input", CellChangeTimes->{{3.613046442940555*^9, 3.6130464691256113`*^9}, 3.613046515822566*^9, {3.613047781331046*^9, 3.6130477819424467`*^9}, { 3.6883010211705647`*^9, 3.688301067982601*^9}, 3.688301128946279*^9, { 3.688301195796957*^9, 3.688301275846979*^9}, 3.688301330510927*^9, { 3.688301373049155*^9, 3.688301393961001*^9}, {3.688301427449625*^9, 3.68830142766224*^9}, {3.688301484550539*^9, 3.6883014896497602`*^9}, { 3.688301593301148*^9, 3.6883016208515053`*^9}, {3.68830167764058*^9, 3.688301706227622*^9}, {3.6883017374286327`*^9, 3.688301770428163*^9}, { 3.68830227393548*^9, 3.6883023804621887`*^9}, {3.6883738074743357`*^9, 3.688373849874008*^9}, {3.688374431036934*^9, 3.6883744657362328`*^9}, { 3.688374536547332*^9, 3.688374577687261*^9}, {3.688374781738389*^9, 3.6883748063008423`*^9}, {3.6885392975776587`*^9, 3.688539314502626*^9}, { 3.68853935221596*^9, 3.6885394161036453`*^9}, {3.6936488290478277`*^9, 3.693648830143045*^9}, {3.693834371896796*^9, 3.693834427154986*^9}, { 3.693834756788741*^9, 3.693834813088876*^9}, {3.6938348939538517`*^9, 3.6938348998978043`*^9}, {3.6938349343128567`*^9, 3.693834968130581*^9}, { 3.892967896767704*^9, 3.892968026651012*^9}, {3.8929682798541937`*^9, 3.892968349672009*^9}, {3.892968653025765*^9, 3.892968653376005*^9}, { 3.892968773874217*^9, 3.8929687843181458`*^9}, {3.892969924709857*^9, 3.8929700081978893`*^9}}], Cell[BoxData["5"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010536208*^9}}], Cell[BoxData["1.6353828943279065`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010544877*^9}}], Cell[BoxData["15.50731305586545`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010550754*^9}}], Cell[BoxData["0.00001866875450146012`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.8929700105572977`*^9}}], Cell[BoxData["0.00017702412164229969`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010563345*^9}}], Cell[BoxData["5648.947672908838`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010569584*^9}}], Cell[BoxData["53565.43736872152`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010575729*^9}}], Cell[BoxData["0.000018664383561643838`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010581978*^9}}], Cell[BoxData["0.00017705479452054793`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010587887*^9}}], Cell[BoxData["5647.969052224372`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010594181*^9}}], Cell[BoxData["53577.98165137614`"], "Output", CellChangeTimes->{{3.688539413180184*^9, 3.688539431517209*^9}, 3.693834428357483*^9, 3.6938348143894033`*^9, 3.69383490064172*^9, { 3.693834956013781*^9, 3.693834968811304*^9}, 3.892968314408503*^9, 3.892968350293096*^9, 3.892968653962126*^9, 3.892968799385178*^9, 3.892969953676853*^9, {3.892970001694558*^9, 3.892970010600128*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Question 3", "Subsubsection", CellChangeTimes->{{3.728978072142015*^9, 3.728978078436468*^9}, { 3.7289787758916683`*^9, 3.728978777915042*^9}, {3.728979117073182*^9, 3.728979124168069*^9}, {3.72897937739428*^9, 3.7289793834544497`*^9}, { 3.728980621199177*^9, 3.728980659270624*^9}, {3.72898742841497*^9, 3.728987435586033*^9}, {3.8872035562635403`*^9, 3.887203571506999*^9}, { 3.889075948658783*^9, 3.889075948905105*^9}, {3.889233499580864*^9, 3.889233499742189*^9}, {3.893051552889963*^9, 3.893051553359744*^9}, { 3.893068465963595*^9, 3.893068480337051*^9}, {3.893068535343358*^9, 3.893068536877803*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{ SubscriptBox["\[Lambda]", "0"], "=", "0.25"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"k", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[Chi]", "[", RowBox[{"z_", ",", "\[Lambda]_"}], "]"}], "=", RowBox[{"PDF", "[", RowBox[{ RowBox[{"PoissonDistribution", "[", "\[Lambda]", "]"}], ",", "z"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"\[Beta]", "[", RowBox[{"z_", ",", "\[Lambda]_"}], "]"}], "=", RowBox[{"CDF", "[", RowBox[{ RowBox[{"PoissonDistribution", "[", "\[Lambda]", "]"}], ",", "z"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"Q", "[", "\[Lambda]_", "]"}], "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"j", "==", "0"}], ",", RowBox[{"\[Beta]", "[", RowBox[{ RowBox[{"k", "-", "i"}], ",", "\[Lambda]"}], "]"}], ",", RowBox[{"\[Chi]", "[", RowBox[{ RowBox[{"k", "+", "j", "-", "i"}], ",", "\[Lambda]"}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", "0", ",", "x"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "0", ",", "x"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"um", "=", RowBox[{"Table", "[", RowBox[{"1", ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "x"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"MatrixForm", "[", RowBox[{"Q", "[", SubscriptBox["\[Lambda]", "0"], "]"}], "]"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Requested", " ", "probability"}], " ", "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Q", "[", SubscriptBox["\[Lambda]", "0"], "]"}], ".", "um"}], ")"}], "[", RowBox[{"[", "1", "]"}], "]"}], ",", "0.0001"}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"In", "-", RowBox[{"control", " ", "ARL"}]}], " ", "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ID", "=", RowBox[{"IdentityMatrix", "[", RowBox[{"x", "+", "1"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"M", "[", "\[Lambda]_", "]"}], ":=", " ", RowBox[{"Inverse", "[", RowBox[{"ID", "-", RowBox[{"Q", "[", "\[Lambda]", "]"}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ SubscriptBox["um", "\[Mu]"], "=", RowBox[{"Table", "[", RowBox[{"1", ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "x"}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"ARL", "[", RowBox[{"i_", ",", "\[Lambda]_"}], "]"}], ":=", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"j", "==", "i"}], ",", "1", ",", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "0", ",", "x"}], "}"}]}], "]"}], " ", ".", " ", RowBox[{"M", "[", "\[Lambda]", "]"}], " ", ".", " ", "um"}]}], ";"}], "\n", RowBox[{"ARL", "[", RowBox[{"0", ",", SubscriptBox["\[Lambda]", "0"]}], "]"}]}], "Input", CellChangeTimes->{{3.5794422918609324`*^9, 3.579442296907168*^9}, { 3.579442333845648*^9, 3.5794423572759113`*^9}, {3.579442423409051*^9, 3.579442528889213*^9}, {3.579530033326294*^9, 3.5795300694046183`*^9}, { 3.5795301056273813`*^9, 3.579530111549124*^9}, {3.579530145765476*^9, 3.579530281038266*^9}, {3.579530312950289*^9, 3.579530371288289*^9}, { 3.579530412382588*^9, 3.5795304309515133`*^9}, {3.5795307228749866`*^9, 3.579530744194628*^9}, {3.579530791730218*^9, 3.5795307918556633`*^9}, 3.579530897411347*^9, {3.579530933587552*^9, 3.579530936567577*^9}, { 3.893051566581119*^9, 3.893051576440682*^9}, {3.8930673383964357`*^9, 3.893067462638874*^9}, {3.893067666097631*^9, 3.89306767636898*^9}, { 3.8930679839851837`*^9, 3.893068127899637*^9}, {3.8930681634579363`*^9, 3.893068182478664*^9}, {3.893068246878912*^9, 3.893068392966077*^9}, { 3.893068546196722*^9, 3.893068609944566*^9}, {3.8930686709915648`*^9, 3.893068807052113*^9}, {3.893068837892158*^9, 3.893068924824996*^9}, { 3.893070221508581*^9, 3.8930702367539673`*^9}, {3.893070409638088*^9, 3.8930704522994337`*^9}, {3.893070491865858*^9, 3.89307055429599*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0.9735009788392561`", "0.024337524470981402`"}, {"0.7788007830714049`", "0.19470019576785122`"} }, 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.893068556046102*^9, 3.893068610354168*^9}, { 3.8930687402027693`*^9, 3.89306880763829*^9}, {3.893068864129877*^9, 3.893068925224126*^9}, {3.893070226939093*^9, 3.893070237326508*^9}, 3.893070412633313*^9, {3.8930705198651648`*^9, 3.893070577348205*^9}}], Cell[BoxData["0.9978`"], "Output", CellChangeTimes->{{3.893068556046102*^9, 3.893068610354168*^9}, { 3.8930687402027693`*^9, 3.89306880763829*^9}, {3.893068864129877*^9, 3.893068925224126*^9}, {3.893070226939093*^9, 3.893070237326508*^9}, 3.893070412633313*^9, {3.8930705198651648`*^9, 3.893070577353991*^9}}], Cell[BoxData["347.7727056358497`"], "Output", CellChangeTimes->{{3.893068556046102*^9, 3.893068610354168*^9}, { 3.8930687402027693`*^9, 3.89306880763829*^9}, {3.893068864129877*^9, 3.893068925224126*^9}, {3.893070226939093*^9, 3.893070237326508*^9}, 3.893070412633313*^9, {3.8930705198651648`*^9, 3.893070577356531*^9}}] }, Open ]] }, Open ]] }, WindowSize->{661, 1279}, WindowMargins->{{Automatic, 4}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, FrontEndVersion->"10.2 for Mac OS X x86 (32-bit, 64-bit Kernel) (July 29, \ 2015)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 439, 6, 35, "Subsubsection"], Cell[CellGroupData[{ Cell[1022, 30, 563, 8, 29, "Subsubsection"], Cell[CellGroupData[{ Cell[1610, 42, 4077, 101, 352, "Input"], Cell[5690, 145, 379, 5, 28, "Output"], Cell[6072, 152, 397, 5, 28, "Output"], Cell[6472, 159, 396, 5, 28, "Output"], Cell[6871, 166, 403, 5, 28, "Output"], Cell[7277, 173, 401, 5, 28, "Output"], Cell[7681, 180, 396, 5, 28, "Output"], Cell[8080, 187, 396, 5, 28, "Output"], Cell[8479, 194, 402, 5, 28, "Output"], Cell[8884, 201, 401, 5, 28, "Output"], Cell[9288, 208, 396, 5, 28, "Output"], Cell[9687, 215, 396, 5, 28, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[10132, 226, 635, 9, 35, "Subsubsection"], Cell[CellGroupData[{ Cell[10792, 239, 4487, 121, 320, "Input"], Cell[15282, 362, 947, 21, 47, "Output"], Cell[16232, 385, 321, 4, 28, "Output"], Cell[16556, 391, 332, 4, 28, "Output"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)