(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 51928, 1368] NotebookOptionsPosition[ 51063, 1333] NotebookOutlinePosition[ 51441, 1350] CellTagsIndexPosition[ 51398, 1347] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"(*", RowBox[{"Enter", " ", StyleBox[ RowBox[{ StyleBox["f", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "ul", StyleBox[ StyleBox[ StyleBox["l", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "file", " ", "path", " ", "and", " ", StyleBox[ RowBox[{ StyleBox["t", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "ransfe", StyleBox[ StyleBox[ StyleBox["r", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "dilution", " ", "factor"}], "*)"}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"file", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dilution", "=", "100"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"contents", "=", RowBox[{"Import", "[", RowBox[{"file", ",", "\"\\""}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"data", "=", RowBox[{"contents", "[", RowBox[{"[", RowBox[{"2", ";;"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"obs", "=", RowBox[{"Length", "[", "data", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"measurements", "=", RowBox[{ RowBox[{"contents", "[", RowBox[{"[", "1", "]"}], "]"}], "[", RowBox[{"[", RowBox[{"3", ";;"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"timepoints", "=", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"FromDigits", "[", RowBox[{"ToExpression", "[", RowBox[{"Select", "[", RowBox[{ RowBox[{"Characters", "[", RowBox[{"measurements", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], ",", "DigitQ"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "measurements", "]"}], ",", "2"}], "}"}]}], "]"}], "[", RowBox[{"[", RowBox[{"2", ";;"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"d", "=", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"ConstantArray", "[", RowBox[{ RowBox[{"timepoints", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "obs"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"pi", "=", RowBox[{"Flatten", "[", RowBox[{"Transpose", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"ConstantArray", "[", RowBox[{ RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], "/", RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], "+", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "4"}], "]"}], "]"}]}], ")"}]}], ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "obs"}], "}"}]}], "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"pf", "=", RowBox[{"Flatten", "[", RowBox[{"Transpose", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", RowBox[{"5", "+", "x"}]}], "]"}], "]"}], "/", RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", RowBox[{"5", "+", "x"}]}], "]"}], "]"}], "+", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", RowBox[{"6", "+", "x"}]}], "]"}], "]"}]}], ")"}]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", RowBox[{"Length", "[", "timepoints", "]"}], ",", "2"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "obs"}], "}"}]}], "]"}], "]"}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.6350065830854483`*^9, 3.635006583295236*^9}, { 3.635006638900206*^9, 3.6350066482234373`*^9}, {3.635006780854149*^9, 3.635006827180011*^9}, {3.6350069686709633`*^9, 3.635006973168907*^9}, { 3.6350075576446743`*^9, 3.6350076297256727`*^9}, {3.635007663475518*^9, 3.635007677261013*^9}, {3.6350077415294733`*^9, 3.6350077710493603`*^9}, { 3.635008058613079*^9, 3.6350080650430813`*^9}, {3.635008704105913*^9, 3.635008706019142*^9}, {3.635008745244429*^9, 3.635008750132563*^9}, { 3.635009048036426*^9, 3.635009052958086*^9}, {3.635009852600604*^9, 3.635009857486088*^9}, {3.635009997938878*^9, 3.635010002160015*^9}, { 3.635011066717619*^9, 3.635011072233459*^9}, {3.635011288396665*^9, 3.6350112939802103`*^9}, {3.635011349194275*^9, 3.635011356596673*^9}, { 3.635011529951881*^9, 3.635011536862439*^9}, {3.635011603835594*^9, 3.635011664511651*^9}, 3.635011798423415*^9, {3.635013728277968*^9, 3.6350137327584743`*^9}, {3.635013780108574*^9, 3.635013785080413*^9}, { 3.6350150411362467`*^9, 3.635015070795018*^9}, {3.6350151238717813`*^9, 3.635015146561042*^9}, {3.63501851377385*^9, 3.635018567531474*^9}, { 3.635018617177603*^9, 3.6350186210006027`*^9}, {3.635019329228404*^9, 3.635019330731675*^9}, {3.6350198806924562`*^9, 3.6350198812772913`*^9}, { 3.6350224533484*^9, 3.635022453987644*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"(*", RowBox[{ StyleBox[ RowBox[{"Calculate", StyleBox["s", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], " ", "best", " ", StyleBox[ RowBox[{"fi", StyleBox["t", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], " ", "to", " ", "linear", " ", "frequency", " ", "dependence"}], "*)"}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Solvepf", "[", RowBox[{ RowBox[{"m_", "?", "NumericQ"}], ",", RowBox[{"s_", "?", "NumericQ"}], ",", "pi_", ",", "d_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"p", "[", "t", "]"}], "/.", RowBox[{ RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"p", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"p", "[", "t", "]"}], " ", "s", " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"p", "[", "t", "]"}]}], ")"}], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"m", " ", RowBox[{"p", "[", "t", "]"}]}]}], ")"}]}]}], ",", RowBox[{ RowBox[{"p", "[", "0", "]"}], "\[Equal]", "pi"}]}], "}"}], ",", "p", ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "1000"}], "}"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], "/.", RowBox[{"t", "\[Rule]", RowBox[{"d", " ", RowBox[{"Log", "[", RowBox[{"2", ",", "dilution"}], "]"}]}]}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"pfmodel", "[", RowBox[{"m_", ",", "s_"}], "]"}], ":=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Solvepf", "[", RowBox[{"m", ",", "s", ",", RowBox[{"pi", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"d", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{ RowBox[{"Length", "[", "timepoints", "]"}], "*", "obs"}]}], "}"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"RSS", "[", RowBox[{"m_", ",", "s_"}], "]"}], ":=", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", " ", RowBox[{"pf", "-", RowBox[{"pfmodel", "[", RowBox[{"m", ",", "s"}], "]"}]}], ")"}], "^", "2"}], "]"}]}], "\[IndentingNewLine]", RowBox[{"minstats", "=", RowBox[{"NMinimize", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"RSS", "[", RowBox[{"m", ",", "s"}], "]"}], ",", RowBox[{ RowBox[{"-", "10"}], "<", "m", "<", "10"}], ",", RowBox[{"0", "<", "s", "<", "0.1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"m", ",", "s"}], "}"}]}], "]"}]}], " ", StyleBox[ RowBox[{"(*", RowBox[{ StyleBox[ RowBox[{"M", StyleBox[ StyleBox["i", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "ni", StyleBox[ StyleBox["m", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "iz", StyleBox[ StyleBox["e", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[ StyleBox[ StyleBox["s", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"]}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[ RowBox[{ StyleBox[ StyleBox["s", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "um"}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[ StyleBox[ RowBox[{"o", StyleBox["f", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"]}], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], RowBox[{ StyleBox[ RowBox[{ StyleBox[ StyleBox["s", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "qu", StyleBox[ StyleBox["a", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "re", StyleBox[ StyleBox["s", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"]}]], StyleBox[ StyleBox[".", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[ RowBox[{ StyleBox[ StyleBox[ StyleBox["C", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "hange"}]]}], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox["restrictions", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox["on", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox["fit", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "parameters", " ", StyleBox["as", "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], " ", "necessary"}], "*)"}], "Input", FontFamily->"Arial Bold", FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"RSSmin", ",", "mbest", ",", "sbest"}], "}"}], "=", RowBox[{"{", RowBox[{ RowBox[{"minstats", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"m", "/.", RowBox[{"minstats", "[", RowBox[{"[", "2", "]"}], "]"}]}], ",", RowBox[{"s", "/.", RowBox[{"minstats", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.634671964523636*^9, 3.634671965644165*^9}, { 3.634672261423654*^9, 3.634672266766992*^9}, {3.634672395682789*^9, 3.634672396563456*^9}, {3.6346731571324177`*^9, 3.6346731574204273`*^9}, { 3.635008085091281*^9, 3.635008085384759*^9}, {3.635008695151277*^9, 3.635008697181139*^9}, {3.635011848990505*^9, 3.635011941557233*^9}, { 3.635011988973303*^9, 3.635011998469254*^9}, {3.635012037401129*^9, 3.635012047971497*^9}, {3.635012927036079*^9, 3.635012928498831*^9}, { 3.635018769886806*^9, 3.635018786576028*^9}, {3.6350189230590487`*^9, 3.635018930351615*^9}, {3.6350193453508883`*^9, 3.635019391532845*^9}, { 3.635019723236779*^9, 3.635019735451383*^9}, {3.635019876705366*^9, 3.635019876970837*^9}, {3.635034803415392*^9, 3.635034804077785*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"0.18166904739568462`", ",", RowBox[{"{", RowBox[{ RowBox[{"m", "\[Rule]", "7.836322939235409`"}], ",", RowBox[{"s", "\[Rule]", "0.011524562350227686`"}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{ 3.6350081097489643`*^9, 3.635008682724991*^9, 3.63500873090084*^9, 3.635008769284604*^9, 3.635009076639944*^9, 3.635009873725634*^9, 3.635010025844489*^9, 3.6350110435162067`*^9, 3.6350110968377132`*^9, 3.635011265158504*^9, 3.635011318532987*^9, 3.635011372647958*^9, 3.635011504369431*^9, 3.635011560617778*^9, 3.6350120711140003`*^9, 3.635013749401882*^9, 3.635013808617393*^9, 3.6350150346499643`*^9, 3.635015121055039*^9, 3.635018571254003*^9, 3.635018604883842*^9, 3.6350187566158257`*^9, 3.635018792899404*^9, {3.635018894166264*^9, 3.63501893402944*^9}, {3.635019341368413*^9, 3.6350193988287163`*^9}, 3.63501976127979*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"(*", RowBox[{ StyleBox[ RowBox[{"Calculate", StyleBox["s", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], " ", StyleBox[ RowBox[{ StyleBox[ StyleBox["e", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "quilibrium"}]], " ", "frequency"}], "*)"}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ FractionBox["1", "m"], "/.", RowBox[{"{", RowBox[{"m", "\[Rule]", "mbest"}], "}"}]}]}]], "Input", CellChangeTimes->{{3.63501499719383*^9, 3.635015003056872*^9}}], Cell[BoxData["0.1276108715470537`"], "Output", CellChangeTimes->{3.6350150376157837`*^9, 3.635015135680974*^9, 3.6350188122963877`*^9, 3.63501893891635*^9, 3.6350194016852493`*^9, 3.63501976918122*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"(*", RowBox[{ "Plots", " ", "initial", " ", "and", " ", "final", " ", "frequencies", " ", "along", " ", "with", " ", "model", " ", "best", " ", RowBox[{"fit", ".", " ", "Each"}], " ", StyleBox[ RowBox[{ StyleBox["co", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "lo", StyleBox["r", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], " ", "is", " ", "a", " ", "different", " ", "timepoint"}], "*)"}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"pitable", "=", RowBox[{"Table", "[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"i", ",", ".01", ",", ".99", ",", ".01"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"pfmodeltable", "=", RowBox[{"Transpose", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"Solvepf", "[", RowBox[{"mbest", ",", "sbest", ",", RowBox[{"pitable", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"timepoints", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "99"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{ RowBox[{"pi", "[", RowBox[{"[", RowBox[{ RowBox[{"1", "+", RowBox[{"obs", "*", RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}]}], ";;", RowBox[{"obs", "*", "i"}]}], "]"}], "]"}], ",", RowBox[{"pf", "[", RowBox[{"[", RowBox[{ RowBox[{"1", "+", RowBox[{"obs", "*", RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}]}], ";;", RowBox[{"obs", "*", "i"}]}], "]"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"{", RowBox[{"PointSize", "[", ".015", "]"}], "}"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"ListLinePlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"pitable", ",", RowBox[{"pfmodeltable", "[", RowBox[{"[", "i", "]"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"{", RowBox[{"Thick", ",", "Dashed"}], "}"}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "Full"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"Axes", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "True"}], ",", "\[IndentingNewLine]", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", " ", RowBox[{ "\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"FrameTicks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Automatic", ",", " ", "None"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "None"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"FrameTicksStyle", "\[Rule]", RowBox[{"Directive", "[", "12", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"LabelStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"FontFamily", "\[Rule]", "\"\\""}], ",", "14"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}]}]], "Input", CellChangeTimes->{{3.635009921269802*^9, 3.635009926206593*^9}, { 3.635009956686315*^9, 3.635009991395488*^9}, {3.635010031997984*^9, 3.635010178808426*^9}, {3.635010673437625*^9, 3.6350106754599943`*^9}, { 3.6350120617975397`*^9, 3.635012103815159*^9}, {3.635012185943219*^9, 3.635012196205968*^9}, {3.635013139762968*^9, 3.63501314307181*^9}, { 3.635032997958091*^9, 3.635032998813097*^9}}], Cell[BoxData[ GraphicsBox[{{ {Hue[0.67, 0.6, 0.6], PointSize[0.015], PointBox[CompressedData[" 1:eJwVhQssFAAAho9qpOvktORq6doy5JGRNtQ/eoh0TFLqmtcYUbnKjAmZJtE4 zSPvtFCd5bEmj2V35w7zuuMc4xzHuTuPu7xC1ql8+7591NDHfuG6BALB8n+7 j2lX33Pf6EBs7Eju+hwHLdEszyO1XPyk8MzLDnKQ0kshU1Q8FBbswgdF6WSw rM/BVuGB3i0+D2NBpcRThu1orHHtpEfyUKZ9a2FNYyMlvEpww5OH4uqo/45j xKwkr6SiE451q7xlnz6w6S5nR0l9+Ft9ldfxSYjG+gG9sJB+aNxS44vuiGCs 5xuYV9OF12VjmWVjPfi4wty/TuuH1nfY8JxWAE/fm9Tx5R6Ux6/oFx2dAa36 K5kfIYSHPWfPmdMTeJOWqtjeGUKaaXqX2mEKQVRWN5MlRHpAgfezPxI0kELu ZiUIcT+o+9dL+hQ4lv1ZYArgs9RJW7osg3OeWkg8KUBYZfr5YucpSDxizdjP RZAb6rnuxE5j+1sGPYAowvIDhrEifg4vrBy3b9mNwq5VVZVlK4OUK27WuTSC 96SFStLCNJiWS8VysgiV3vR5aeoMjCLaDkW0CeDg7FUf+lmOGP/NtIZoEQSt 7MO/WbNwmtzaFBuJwAhIdi/NV0LH6vrq+hMRaltkbeYmcoAYnGkzKUZJVzbX L2YWSYM5RBvVGBLLlQnlynkY+g88kt2eQPpmHXMkXIWk1DCjHcY4Lj58+iqK sIi9cYNphA+ToOcy3Pj75kGt0U2WiaX44Zw08YWrREk+OXL6mAReOdaZysUF HOctDWYMT2OweYavyNaAFa3JieufQ1egfGNNoUHiNQX1XYYcXAojeG1bjcZR Wwxp55BXRd35HqdGxahp8IVOGVj2zBO1pWroNEnETTI5xpkmXIlUDQMLlyvZ UOAfrztc+g== "]]}, {Hue[0.9060679774997897, 0.6, 0.6], PointSize[0.015], PointBox[CompressedData[" 1:eJwdj3ss1AEAxz0qolieubZKpmmUTGF29eXWiMlJMaFd07QRYdItlXM6hRRX aSaHVNd5pZXmkRLn7ncvj6i5vB/Hed3tLkUsSj77fvb9+2MblRAcraejo3Ng 3f8f16yKoCy2wMj4Z4A1uR2Nl6v9rHh8GLPY16q9RGBISWakaQEEBertDuYE SEo3I41hG9ozXIySIySQ04q37TNtRqlPmDqGJQBn9ZGDU2ArqGscqS2PQBE3 Zn394C0XMItoYhyp+SHQUGXQ882583tCiL9cH0FLxRdw/cmdfVIJ1N7p9MKw rwjZQIAcjjybIxfjRW+CYweJwGpQr+nR1W5EMkgmjWIRSuhaw8Kd46Dc2Kqy ryPg69Km72g/AI/w97I8kgQZNixC5TqCK0UHZUNcMVihTwKu/hlEmWTHim6l DOdpol+ZkSOwomktaVoBqPPtgfMnxjAYVXV7z10CF8tY7kWeI7i0QScUpgbk tcRRbHqY8pq8VwxNbJL5FH0Sy/fjfWqYMjg3TZffOzSGjk65xS21EM9MZst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/HzY7UiFM5n5uhtsA+RchkbWovls8AE+rnPVi 7KsRvGr3GKQ8xFhWlL93N3MQMResJcHF0ofNa9yHKB8pWryafiwsGIK1m2uD FJ1ng9u5bw9TXjIwHnywZfjWMBas7cwyqE63VugtPpfyk+Pm/BTffJAHP9sC KHDztyG/8mQe5anABd+C9L9+58EmL2sEsWyz/l8jj/JVYn63Q0b/Zj4GB6yl hOHjt/wSzvEp71H0RqweWyjnw80mUIUc8bWVcXI+5a9CceXsKbWLALZ2EWP4 PkZyLTJYQDzU8O0pdTHfEpAfNa4o2IksjoD4qBF4UphX9UZA/tQIc2Ro5fuE xEuDn+4z46KShORXg3URK5ICHwuJnwZxE56rq+eE5F8Lb/ZifvoWEfHUojra /cSLGBGW2mnxNJZxY3mNiPiOoyvxHYZIJ6J8xtEWkHw1/iMx8R6HDytkyHBO THnpoKrgnjpTIyb+OsSGTaVN6cWUnw5RYaH+JZ9IaB8moNTVuhVeklCeE2iB 68xCk4T2YwIXql8v1yxKKN9JpL0If3X1cyntyyRuvWmpHL8npbwnIak/eTxE K6X/fQpM74Uq404Z5T+F4ovVzS8zZLRPU6gv+bC9XCYjHnr03GAU7NghJx56 NEVdjl24LSceeiiT1n16bFpOPPSojsl0zAhSEI9pXFfq1GtZCuIxjQC3832F 60aIxzQePuG0Z+aOEA8DUhzX7ilZpiQeBhy5zo6pyVDSfhqQfs1tZ4XDKPGY gfv+uuus4lHiMYPW7Yl9x3apiMcMujZF2nvIVMRjFoePxn/3xZ0x4jGLr/2S Xo76qInHLDhRAXcNhWriMQf7FU9aHjhpiMccnDX1pw9a9mqJxxxYYu9Nq/do iYcRpbfnK78xaYmHEcZKrZOuf5x4GDHILD/SNKIjHiZMZo+n79o3STxMKL7p 7CJ6T088TAjVy4o7Jw34Hy3VI8I= "]]}, {Hue[0.9060679774997897, 0.6, 0.6], Thickness[Large], Dashing[{Small, Small}], LineBox[CompressedData[" 1:eJwtkwlMkwcYhkEmAjoBo8Z4cMyIMKckAnMe8LI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nr41Nzr6OyX0j70YN9RWVuJu4zy 7AHTN7Q6KFxG+9GDUFeZLSdLRvn2gld0xLSWK6N96YX8e6l/37iM8u7F00nM WEmAnP53AyKw+ohropzyN+Dh8uCIrkdy2icD/vEMZkaZ5cTDCI5nEmf/bAXx MOJtFI9ze4WCeBgRr5734yd7FcTDCHGnL7fqZwXx6INnTshBfaGCePThs0r2 3CdCBfHow6GcnaMR7xTEox/Oosen3RYoiUc/Wg0zR0I3KWk/+zHD9YTv0mQl 8TDhdonCKeSRkniYwDfU20/XK4mHCfbpUYtXuKuIhxlej5cdY+xXEQ8z7nra Tw68pyIeZgjEHw7c+ltFPAbgc+diXMHmFuIxAPGNVWOTK1qIxwBKkg2Haxe1 Eo9B+GX9skpe3ko8BlGdca1tVuRz4jEIRmGmi8vKF8TjDa63xyxxPKwmHm8g 0Mcle21sJx5vEH05w793Rif+B18+Hfs= "]]}}}, AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948], Axes->False, Frame->True, FrameLabel->{ FormBox["\"Initial frequency of red competitor\"", TraditionalForm], FormBox["\"Final frequency of red competitor\"", TraditionalForm]}, FrameTicks->{{Automatic, None}, {Automatic, None}}, FrameTicksStyle->Directive[12], LabelStyle->{FontFamily -> "Arial", 14}, PlotRange->{0, 1}, PlotRangeClipping->True]], "Output", CellChangeTimes->{ 3.63500992689489*^9, {3.635009974703271*^9, 3.6350099923425007`*^9}, { 3.63501002881562*^9, 3.635010040830052*^9}, {3.635010076048321*^9, 3.6350101799068003`*^9}, 3.63501105097148*^9, 3.635011101702694*^9, 3.6350112691957703`*^9, 3.635011321207396*^9, 3.635011390334675*^9, { 3.63501150972626*^9, 3.635011515110525*^9}, 3.635011571256455*^9, 3.635013756927087*^9, 3.6350138110620823`*^9, 3.6350188164706182`*^9, 3.635018940625534*^9, 3.635019403614875*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"(*", RowBox[{"Plots", " ", StyleBox[ RowBox[{ StyleBox[ StyleBox["f", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "itness"}]], " ", "if", " ", "assumed", " ", "to", " ", "be", " ", "constant", " ", "over", " ", RowBox[{"competition", StyleBox[".", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ RowBox[{ StyleBox[ StyleBox[ StyleBox[ StyleBox["E", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "ac", StyleBox["h", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]]}], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ RowBox[{ StyleBox[ StyleBox["c", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "olor"}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ RowBox[{"i", StyleBox[ StyleBox["s", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ StyleBox[ StyleBox["a", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ RowBox[{ StyleBox[ StyleBox[ StyleBox["d", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "if", StyleBox["f", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "er", StyleBox["e", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "nt"}]], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], RowBox[{ StyleBox[ RowBox[{ StyleBox[ StyleBox[ StyleBox["t", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "im", StyleBox["e", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "po", StyleBox["i", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "nt"}]], StyleBox[".", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], " ", StyleBox[ RowBox[{ StyleBox[ StyleBox["B", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "lack"}]]}], " ", "line", " ", "is", " ", "the", " ", "best", " ", "fit", " ", "linear", " ", "frequency", " ", "dependence", " ", "from", " ", "the", " ", RowBox[{"model", "."}]}], "*)"}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"fitness", "[", RowBox[{"pi_", ",", "pf_", ",", "d_"}], "]"}], ":=", RowBox[{ RowBox[{"(", FractionBox[ RowBox[{"pf", " ", RowBox[{"(", RowBox[{"1", "-", "pi"}], ")"}]}], RowBox[{"pi", " ", RowBox[{"(", RowBox[{"1", "-", "pf"}], ")"}]}]], ")"}], "^", RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"d", " ", RowBox[{"Log", "[", RowBox[{"2", ",", "dilution"}], "]"}]}], ")"}]}], ")"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"w", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"fitness", "[", RowBox[{ RowBox[{"pi", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"pf", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"d", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"obs", "*", RowBox[{"Length", "[", "timepoints", "]"}]}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"wmodeltable", "=", RowBox[{"Transpose", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"fitness", "[", RowBox[{ RowBox[{"pitable", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"Solvepf", "[", RowBox[{"mbest", ",", "sbest", ",", RowBox[{"pitable", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"timepoints", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], ",", RowBox[{"timepoints", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "99"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{ RowBox[{"pi", "[", RowBox[{"[", RowBox[{ RowBox[{"1", "+", RowBox[{"obs", "*", RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}]}], ";;", RowBox[{"obs", "*", "i"}]}], "]"}], "]"}], ",", RowBox[{"w", "[", RowBox[{"[", RowBox[{ RowBox[{"1", "+", RowBox[{"obs", "*", RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}]}], ";;", RowBox[{"obs", "*", "i"}]}], "]"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"{", RowBox[{"PointSize", "[", ".015", "]"}], "}"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"ListLinePlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"pitable", ",", RowBox[{"wmodeltable", "[", RowBox[{"[", "i", "]"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "timepoints", "]"}]}], "}"}]}], "]"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"{", RowBox[{"Thick", ",", "Dashed"}], "}"}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "Full"}]}], "]"}], ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{ RowBox[{"1", "+", RowBox[{"s", " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"m", " ", "p"}]}], ")"}]}]}], "/.", RowBox[{"{", RowBox[{ RowBox[{"m", "\[Rule]", "mbest"}], ",", RowBox[{"s", "\[Rule]", "sbest"}]}], "}"}]}], ",", RowBox[{"{", RowBox[{"p", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Black", ",", "Thick"}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"Axes", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "True"}], ",", "\[IndentingNewLine]", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", " ", RowBox[{ "\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"FrameTicks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Automatic", ",", " ", "None"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "None"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"FrameTicksStyle", "\[Rule]", RowBox[{"Directive", "[", "12", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"LabelStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"FontFamily", "\[Rule]", "\"\\""}], ",", "14"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}]}]], "Input", CellChangeTimes->{{3.63501061640662*^9, 3.635010651489225*^9}, { 3.635010917632259*^9, 3.635010989445421*^9}, {3.635011229656461*^9, 3.635011234173061*^9}, {3.6350114586745987`*^9, 3.635011459196578*^9}, { 3.635012138853189*^9, 3.635012291078494*^9}, {3.6350132375249557`*^9, 3.63501324089048*^9}, {3.635033005206689*^9, 3.6350330070421867`*^9}}], Cell[BoxData[ GraphicsBox[{{ {Hue[0.67, 0.6, 0.6], PointSize[0.015], PointBox[CompressedData[" 1:eJwVjH0s1HEAhy9qrHCVImdsalHcymvXrPqsq6nMEMuKa+rqmEO5Vbtp3hIr soRqdl4z2aVj/JPXZZyX9OJlvUxcOOSc8/t+fyVKHGl7nj3/PU7i6yESEw6H s3/d/41rZSKEi23Q9E5aGK1ZNMWqztgo1difcM0100CR+o63nTfThVppOuk3 ZcHTHdrMmnegqi1q55oNi6HIYovd3Faw+VplkSeLEmPBPn5gO3LlMZEOdiwU VTHrDEMwVj/SskTgXfOziw16j6v5vyRlRoq1Kr+utheDmDtbZnbnAwU5niYv PP8Jisd17oJ4iuySoaySoV6EGIKEKVtZGIM/cn2MA9De8+GuNVCUyn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0rMUt1q7z/wanET5nflPys/mK7YOO8/ L7rooosu4T8gEvUjLlbvP6EO6qAO6uA/ZkicuJpp7z+gTFzp3oDiPxWaXIBz RO8/MzpKsGKq5D/zFbz0tDXvP9C6wRT5rOM/HMMZERY97z9xVn5CnJXnP/HE XdG1D+8/qLnhuyYX5D83v6THVUbvP5vHjMNSbOM/rG38Yd9i7z96nud5nufp P4tdlIWc4u4/hPetkdVl6D8bt+b3AvvuPz5tc4hpAOs/cqXz2h/U7j9ckHFB xgXpP55n0323/+4/vjp826vD5z+aCQOLYSnvP0qPLInn6+o/Lfm++tjo7j/P t+LG5ozuP/79uuvkce4/x1nk9vPm7j+5afQKnjHuP8MacWDz+u0/0ifyI/GC 7j+SoiH+uHXtP2k893P4ju4/rDGRHqic7T8Gfr63KsruP9qRF8Pc3u0/NRBG vAPI7j9BRV4m "]]}}, {{}, {}, {Hue[0.67, 0.6, 0.6], Thickness[Large], Dashing[{Small, Small}], LineBox[CompressedData[" 1:eJw1k3tQVGUYxtmVshayyYG1olghMlBEdJu8gD5e8soouQ4wzIKjKDhkJimF wCD9IaYOhDmuN8IuojOgrjFLiW4CQqgl2iLJgqywN1iW3f2+TUMuScY5ft87 c+bMub3v8zy/94Sk7VSlS318fLaMH8I5P0C70pK3D5uK507snO7F8+ujQP9B 585pXtQGF7nW157G7Kow7bxQ/rwCq8O6GmYGe3HqpFCV0Exz5a5504sr4vta tP6TaD0k92L8YvxONSbtn3fcNZl/X4NtXbZjma96ITOeyVoou4zDF0ripP5e iO1OXsGE3TWf6F7yIiKltHEw/Ff0FGR48l7geuoQ4ztHkiT1omL8a+OZBvgW xcuL/6Nwi/OuI8dqDy0ZpnhfKVQTRjpv7Nc+omz+b9gVMcXscVM0DYaPT2jG nFsPn65yUPiJem5iljKg+5qFQiUOvAWJLlK7xkSZ398h/+lvvaedwponNPwD 8tuPPz/bSpneFpyXtWdmtVB8JsjLuoMp6sKYtTcpy+cuzs7KrlrQSOEjlgHP Vpz+au41yvwYIAnR/Ly0lmKVRRjQioI4Rbhax/214pc8vbVQS3G4UTBwDx+l SAcvVVKIdpVtyAjxzx+ooBDtGNtwNdN0Mup77v8v9KQPF+aXUSgEOcH3cerI ie2GYzyP++gYOaiJPEKxLUOodvgOfbmytITnY8SSPd/8OXSAQugWoDWiL9U/ J30fz6sDaQ/WlRsLKZ4I7QY7MJw1VbM2n+fXCUnpvPobX1AsEhfgAYjenrd0 F8/zARbaVeENOyhEeUVdeHGrdDoyeb4mLJl201a3leJOi1AmvHcH+kWbeN4P se5pdWCdmiJQFNgNW7w3MTaJ59+NGucFS62KQmyX0oOkzeemKNdxHmYEZ29I qFrN/ZjhX7h07O3lnI8ZOe2jW0sWc39mNCQfsgzFcF4WkKO65pS53K8Fqakm tX4O52dByPxP3ZOjuH8ryiVjurQIztOKcO2OgcowiuftrJi0bKTeoeB8bWjo KE4OCuL52NCbutiwTM552zAkK1Nueo3nZccO99kDO/05fzvarXHXsyby/Oyg aufVNCnfh17INY7lH44Rlmcv3hi6rAgYJmw/ekFrVjsNjwjLtw+j8/Micz2E 7UsfchP8Nvj1E5Z3H17e9XFVkZWw/92B+jNViX0mwvJ3IPb8pfUzjITtkwOY +c4WVSthPPox9etqRfJtwnj0oyJ+d2dsM2E8+vFD2QTNaB1hPPrRNbHxldJa wng4ca7aWvykmjAeTsxw19PI84TxcKL43oJDMysI4zGAi2+F+j3+ljAeAxjt 3r8xR0PYfg5A01K2R1dCGA8XepukK74rIoyHC/l702JnFxDGwwWDNFu2MZsw Hm4EJoysfH07YTzciM59djF+M2E83PjgrjLIm0gYDw+iHUl6cxzn4UFTVHaz ZDHn4YFLpvo3Qsl5EGScWK4IfZfzIEiPPm4vD+Q8CMba1N1RvpwHxbEj59Ij vR7GgyJZkvvj3g4P40Hx2BVfGaT34H/tTyk5 "]]}, {Hue[0.9060679774997897, 0.6, 0.6], Thickness[Large], Dashing[{Small, Small}], LineBox[CompressedData[" 1:eJw1kwlQlHUYxlcuiXtyETGDEEbl1AHC0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es->False, Frame->True, FrameLabel->{ FormBox["\"Frequency of red competitor\"", TraditionalForm], FormBox["\"Fitness of red relative to pink\"", TraditionalForm]}, FrameTicks->{{Automatic, None}, {Automatic, None}}, FrameTicksStyle->Directive[12], LabelStyle->{FontFamily -> "Arial", 14}, PlotRange->Automatic, PlotRangeClipping->True]], "Output", CellChangeTimes->{ 3.635010871038603*^9, 3.635010944353175*^9, 3.6350109916950293`*^9, 3.6350110582831182`*^9, 3.635011104943598*^9, 3.635011235073151*^9, 3.635011276170012*^9, {3.635011324918442*^9, 3.635011331851253*^9}, 3.635011393261598*^9, 3.635011461479459*^9, 3.6350115203996687`*^9, 3.6350115743658123`*^9, 3.6350137594516087`*^9, 3.635013813873467*^9, 3.635018946850391*^9, 3.635019406906054*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"(*", RowBox[{ StyleBox[ RowBox[{"AI", StyleBox["C", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[" ", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ RowBox[{ StyleBox[ StyleBox["v", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "al", StyleBox[ StyleBox["u", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], StyleBox[ StyleBox[ StyleBox["e", "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"]}]]}], "*)"}], "Input", FontFamily->"Arial Bold", FontSize->14, FontWeight->"Plain"], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"AIC", "[", RowBox[{"k_", ",", "n_", ",", "err_"}], "]"}], ":=", RowBox[{ RowBox[{"2", " ", "k", " ", RowBox[{"(", RowBox[{"n", "/", RowBox[{"(", RowBox[{"n", "-", "k", "-", "1"}], ")"}]}], ")"}]}], "+", RowBox[{"n", " ", RowBox[{"Log", "[", RowBox[{"err", "/", "n"}], "]"}]}]}]}], "\[IndentingNewLine]", RowBox[{"AIC", "[", RowBox[{"2", ",", RowBox[{ RowBox[{"Length", "[", "timepoints", "]"}], "*", "obs"}], ",", "RSSmin"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.634673160407503*^9, 3.634673179185616*^9}, { 3.635012300077875*^9, 3.635012309723063*^9}, {3.635013547785034*^9, 3.63501355111163*^9}}], Cell[BoxData[ RowBox[{"-", "497.05571032917635`"}]], "Output", CellChangeTimes->{{3.634673161364336*^9, 3.634673179502131*^9}, 3.635006362231751*^9, 3.6350110027617607`*^9, 3.635011061372067*^9, 3.635011128277236*^9, 3.6350112373908863`*^9, 3.635011278005937*^9, 3.63501133560964*^9, 3.635011395121359*^9, 3.635011522318429*^9, 3.6350115765975637`*^9, 3.635013761326646*^9, 3.63501381582725*^9}] }, Open ]] }, WindowSize->{1089, 1057}, WindowMargins->{{15, Automatic}, {Automatic, 0}}, ShowSelection->True, FrontEndVersion->"8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (November 6, \ 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[557, 20, 6900, 185, 242, "Input"], Cell[CellGroupData[{ Cell[7482, 209, 8334, 246, 137, "Input"], Cell[15819, 457, 935, 18, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16791, 480, 835, 29, 65, "Input"], Cell[17629, 511, 208, 3, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17874, 519, 5157, 134, 272, "Input"], Cell[23034, 655, 6509, 117, 255, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[29580, 777, 10834, 323, 345, "Input"], Cell[40417, 1102, 8043, 144, 246, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[48497, 1251, 2134, 71, 62, "Input"], Cell[50634, 1324, 413, 6, 27, "Output"] }, Open ]] } ] *) (* End of internal cache information *)