(*^
::[ Information =
"This is a Mathematica Notebook file. It contains ASCII text, and can be
transferred by email, ftp, or other text-file transfer utility. It should
be read or edited using a copy of Mathematica or MathReader. If you
received this as email, use your mail application or copy/paste to save
everything from the line containing (*^ down to the line containing ^*)
into a plain text file. On some systems you may have to give the file a
name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
The line below identifies what version of Mathematica created this file,
but it can be opened using any other version as well.";
FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2";
MacintoshStandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times";
fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times";
fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier";
fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier";
fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier";
fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier";
fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier";
fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva";
fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = leftheader, inactive, L2, 12, "Times";
fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times";
fontset = leftfooter, inactive, L2, 12, "Times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
paletteColors = 128; automaticGrouping; currentKernel;
]
:[font = input; preserveAspect]
ClearAll;Clear[f1];Clear[f2];
$DefaultFont = {"Times-Roman",10};
Needs["Statistics`DataManipulation`"];
Needs["Graphics`Graphics`"];
cumulative = {312/545,413/545,487/545,522/545,537/545,1};
datapoints = {{0,0},{1,312/545},{2,413/545},
{3,487/545},{4,522/545},{5,537/545},{6,1}};
density = {312/545,101/545,74/545,35/545,15/545,8/545};
F1[A_,th_,c_,t_] = (3 th + (th + 2)A)t/(2(th+1)c) - A(t/c)^2 + ((-th + (th+2)A)/(2(th+3))) (t/c)^3;
F2[A_,th_,c_,t_] = 1 - ((3-A)/((3+th)(1+th))) (c/t)^th;
f1[A_,th_,c_,t_] = (3 th + (th + 2)A)/(2(th+1)c) - 2A t/(c^2) + 3((-th + (th+2)A)/(2c(th+3))) (t/c)^2;
f2[A_,th_,c_,t_] = (th(3-A)/((3+th)(1+th)c)) (c/t)^(th+1);
FF[A_,th_,c_,t_] = Which[t<=2,F1[A,th,c,t],t>2,F2[A,th,c,t]];
error[A_,th_,c_] = Apply[Plus,Table[(FF[A,th,c,n]-cumulative[[n]])^2,{n,1,6}]];
leasterror = FindMinimum[error[A,th,c],{A,2,2.01,0,4},{th,2,2.01,0,4},{c,2,2.01,0,4}];
Aopt = A/.leasterror[[2]]
thopt = th/.leasterror[[2]]
copt = c/.leasterror[[2]]
F[t_] = Which[t<=copt,F1[Aopt,thopt,copt,t],t>copt,F2[Aopt,thopt,copt,t]];
f[t_] = Which[t<=copt,f1[Aopt,thopt,copt,t],t>copt,f2[Aopt,thopt,copt,t]];
Print["Error is ",leasterror[[1]]];
up:= Show[Plot[f[t],{t,0.001,6}],
PlotRange->{{0,6.05},{0,0.8}},
PlotLabel->FontForm["(a) y = F'(t) = f(t)\n (p.d.f.)",
{"Courier",10}],
AxesOrigin->{-0.15,-0.025},
Axes->True,AxesLabel->{" t","y"}];
down:= Show[Plot[F[t],{t,0.001,6},
PlotRange->{{0,6.05},{0,1.05}},
PlotLabel->FontForm["(b) y = F(t)\n (c.d.f.)",{"Courier",10}],
AxesOrigin->{-0.15,-0.025},
Axes->True,AxesLabel->{" t","y"}],
ListPlot[datapoints]];
Show[GraphicsArray[{{up},{down}}],
PlotLabel->" Figure 27.2\nPrairie dog survival"]
^*)