(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 74687, 2664]*) (*NotebookOutlinePosition[ 75805, 2700]*) (* CellTagsIndexPosition[ 75761, 2696]*) (*WindowFrame->Normal*) Notebook[{ Cell["Generating time series in Mathematica", "Title"], Cell[CellGroupData[{ Cell["First, load in the required packages", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "It's important because otherwise you can't generate normally distributed \ shocks"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Needs["\"]\)], "Input", PageWidth->PaperWidth, AspectRatioFixed->True] }, Open ]], Cell["\<\ This one is also useful in general, and the function EGARCHList \ below depends on some of its contents.\ \>", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["\<\ Note that this package also loads in some others, as shown below. \ This is important if you want to convert this notebook into package \ form.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \($Packages\)], "Input"], Cell[BoxData[ \({"Statistics`Common`DistributionsCommon`", "Statistics`DescriptiveStatistics`", "Statistics`NormalDistribution`", "Statistics`ContinuousDistributions`", "Global`", "System`"}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Random Walk \[LongDash]with or without drift"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "This is a very simple function, using the functional programming construct \ ", StyleBox["NestList[] ", FontWeight->"Bold"], "with a simple pure function. Note that the length of the series generated \ is constrained to be an integer, while the variables ", StyleBox["drift", FontWeight->"Bold"], " and ", StyleBox["sd", FontWeight->"Bold"], " -- the drift and the standard deviation of the shocks -- have default \ values. I haven't constrained the starting value (sv) to be numerical -- \ sometimes you might want to explore the properties of something in algebraic \ terms." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(randomwalk[n_Integer, sv_, sd_: 1, drift_: 0] := Rest[NestList[#1 + Random[NormalDistribution[0, sd]] + drift\ &, sv, n]] \)], "Input", PageWidth->PaperWidth, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["ARMA: generate artificial time series of any order", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Anyone who's done econometrics or time series work would be familiar with \ this sort of process:\n\n\t", Cell[BoxData[ \(TraditionalForm \`y\_t = \[Sum]\+\(i = 1\)\%p\( \[Phi]\_i\) y\_\(t - 1\)\ + \[Sum]\+\(j = 0\)\%q\( \[Theta]\_j\) \[Epsilon]\_\(t - j\)\)]], "\n\nThe \[Epsilon]'s are usually normally distributed, or at least iid. \ (should that be \"normally normally\")." }], "Text"], Cell[BoxData[ \(ARMAList[n_Integer, sv_, sd : \((_Real | _Integer)\), pcoefs : {_, __}, qcoefs_?VectorQ, const_: 0] /; \ VectorQ[pcoefs] := \ With[{p = Length[pcoefs], q = Length[qcoefs], macoefs = Flatten[Reverse[Join[{1}, qcoefs]]], rpcoefs = Reverse[pcoefs], rawshocks = RandomArray[NormalDistribution[0, sd], n + Length[qcoefs]]}, With[{mabit = Expand\ /@ \((Take[ \((macoefs. \((\(RotateLeft[rawshocks, #]&\)\ /@\ Range[0, q])\)) \), n])\)}, \n\t\t\t Rest[Last\ /@\ \((FoldList[Join[Rest[#1], {rpcoefs.#1\ + #2 + const}]&, Table[sv, {p}], mabit])\)]\ ]]\)], "Input"], Cell["\<\ Special Cases for AR(1) processes. The pattern-matching engine \ will pick this up automatically, so you can put the single AR coefficient in \ list brackets or not as you see fit.\ \>", "Text"], Cell[BoxData[ \(ARMAList[n_Integer, sv_, sd : \((_Real | _Integer)\), pcoefs : {_}, qcoefs_?VectorQ, const_: 0] /; \ VectorQ[pcoefs] := \ \n ARMAList[n, sv, sd, pcoefs\[LeftDoubleBracket]1\[RightDoubleBracket], qcoefs, const]\)], "Input"], Cell[BoxData[ \(ARMAList[n_Integer, sv_, sd : \((_Real | _Integer)\), pcoef : \((_Real | _Integer | \ _Symbol)\), qcoefs_?VectorQ, const_: 0] := \ With[{q = Length[qcoefs], macoefs = Flatten[Reverse[Join[{1}, qcoefs]]], rawshocks = RandomArray[NormalDistribution[0, sd], n + Length[qcoefs]]}, With[{mabit = Expand\ /@ \((Take[ \((macoefs. \((\(RotateLeft[rawshocks, #]&\)\ /@\ Range[0, q])\)) \), n])\)}, \n\t\t\t FoldList[pcoef\ *\ #1\ + #2 + const\ &, sv, mabit]\ ]]\)], "Input"], Cell["Special Cases for shock vectors that are already supplied.", "Text"], Cell[BoxData[ \(ARMAList[\[Epsilon]_?VectorQ, sv_, pcoefs : {_, __}, qcoefs_?VectorQ, const_: 0] /; \ VectorQ[pcoefs] := \ With[{p = Length[pcoefs], q = Length[qcoefs], macoefs = Flatten[Reverse[Join[{1}, qcoefs]]], rpcoefs = Reverse[pcoefs], T = Length[\[Epsilon]] - Length[qcoefs]}, With[{mabit = Expand\ /@ \((Take[ \((macoefs. \((\(RotateLeft[\[Epsilon], #]&\)\ /@\ Range[0, q])\)) \), T])\)}, \n\t\t\t Rest[Last\ /@\ \((FoldList[Join[Rest[#1], {rpcoefs.#1\ + #2 + const}]&, Table[sv, {p}], mabit])\)]\ ]]\)], "Input"], Cell[BoxData[ \(ARMAList[\[Epsilon]_?VectorQ, sv_, pcoef : {_}, qcoefs_?VectorQ, const_: 0] /; \ VectorQ[pcoefs] := \ \n ARMAList[\[Epsilon], sv, pcoef\[LeftDoubleBracket]1\[RightDoubleBracket], qcoefs, const]\)], "Input"], Cell[BoxData[ \(ARMAList[\[Epsilon]_?VectorQ, sv_, pcoef : \((_Real | _Integer | \ _Symbol)\), qcoefs_?VectorQ, const_: 0] := \ With[{q = Length[qcoefs], macoefs = Flatten[Reverse[Join[{1}, qcoefs]]], T = Length[\[Epsilon]] - Length[qcoefs]}, With[{mabit = Expand\ /@ \((Take[ \((macoefs. \((\(RotateLeft[\[Epsilon], #]&\)\ /@\ Range[0, q])\)) \), T])\)}, \n\t\t\t\t FoldList[pcoef\ *\ #1\ + #2\ + const\ &, sv, mabit]\ ]]\)], "Input"], Cell["Here is an example.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ListPlot[ARMAList[1000, 0, 0.5, {0.9, 0.09}, {0.8, 0.8, 0.5}, 0.2], PlotJoined \[Rule] True, Frame\ \[Rule] \ True, PlotStyle \[Rule] {AbsoluteThickness[2], Hue[0.57]}\ ] // Timing\)], "Input", PageWidth->PaperWidth, AspectRatioFixed->True], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.0238095 0.000952381 0.0625374 0.011966 [ [.02381 -0.0125 -3 -9 ] [.02381 -0.0125 3 0 ] [.21429 -0.0125 -9 -9 ] [.21429 -0.0125 9 0 ] [.40476 -0.0125 -9 -9 ] [.40476 -0.0125 9 0 ] [.59524 -0.0125 -9 -9 ] [.59524 -0.0125 9 0 ] [.78571 -0.0125 -9 -9 ] [.78571 -0.0125 9 0 ] [.97619 -0.0125 -12 -9 ] [.97619 -0.0125 12 0 ] [ 0 0 -0.125 0 ] [-0.0125 .06254 -6 -4.5 ] [-0.0125 .06254 0 4.5 ] [-0.0125 .1822 -12 -4.5 ] [-0.0125 .1822 0 4.5 ] [-0.0125 .30186 -12 -4.5 ] [-0.0125 .30186 0 4.5 ] [-0.0125 .42152 -12 -4.5 ] [-0.0125 .42152 0 4.5 ] [-0.0125 .54118 -12 -4.5 ] [-0.0125 .54118 0 4.5 ] [ 0 0 -0.125 0 ] [ 0 .61803 .125 0 ] [ 1 0 .125 0 ] [ 0 0 0 0 ] [ 1 .61803 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid [ ] 0 setdash .02381 0 m .02381 .00625 L s [(0)] .02381 -0.0125 0 1 Mshowa .21429 0 m .21429 .00625 L s [(200)] .21429 -0.0125 0 1 Mshowa .40476 0 m .40476 .00625 L s [(400)] .40476 -0.0125 0 1 Mshowa .59524 0 m .59524 .00625 L s [(600)] .59524 -0.0125 0 1 Mshowa .78571 0 m .78571 .00625 L s [(800)] .78571 -0.0125 0 1 Mshowa .97619 0 m .97619 .00625 L s [(1000)] .97619 -0.0125 0 1 Mshowa .125 Mabswid .07143 0 m .07143 .00375 L s .11905 0 m .11905 .00375 L s .16667 0 m .16667 .00375 L s .2619 0 m .2619 .00375 L s .30952 0 m .30952 .00375 L s .35714 0 m .35714 .00375 L s .45238 0 m .45238 .00375 L s .5 0 m .5 .00375 L s .54762 0 m .54762 .00375 L s .64286 0 m .64286 .00375 L s .69048 0 m .69048 .00375 L s .7381 0 m .7381 .00375 L s .83333 0 m .83333 .00375 L s .88095 0 m .88095 .00375 L s .92857 0 m .92857 .00375 L s .25 Mabswid 0 0 m 1 0 L s 0 .06254 m .00625 .06254 L s [(0)] -0.0125 .06254 1 0 Mshowa 0 .1822 m .00625 .1822 L s [(10)] -0.0125 .1822 1 0 Mshowa 0 .30186 m .00625 .30186 L s [(20)] -0.0125 .30186 1 0 Mshowa 0 .42152 m .00625 .42152 L s [(30)] -0.0125 .42152 1 0 Mshowa 0 .54118 m .00625 .54118 L s [(40)] -0.0125 .54118 1 0 Mshowa .125 Mabswid 0 .08647 m .00375 .08647 L s 0 .1104 m .00375 .1104 L s 0 .13433 m .00375 .13433 L s 0 .15827 m .00375 .15827 L s 0 .20613 m .00375 .20613 L s 0 .23006 m .00375 .23006 L s 0 .25399 m .00375 .25399 L s 0 .27793 m .00375 .27793 L s 0 .32579 m .00375 .32579 L s 0 .34972 m .00375 .34972 L s 0 .37365 m .00375 .37365 L s 0 .39759 m .00375 .39759 L s 0 .44545 m .00375 .44545 L s 0 .46938 m .00375 .46938 L s 0 .49332 m .00375 .49332 L s 0 .51725 m .00375 .51725 L s 0 .03861 m .00375 .03861 L s 0 .01467 m .00375 .01467 L s 0 .56511 m .00375 .56511 L s 0 .58904 m .00375 .58904 L s 0 .61298 m .00375 .61298 L s .25 Mabswid 0 0 m 0 .61803 L s .02381 .61178 m .02381 .61803 L s .21429 .61178 m .21429 .61803 L s .40476 .61178 m .40476 .61803 L s .59524 .61178 m .59524 .61803 L s .78571 .61178 m .78571 .61803 L s .97619 .61178 m .97619 .61803 L s .125 Mabswid .07143 .61428 m .07143 .61803 L s .11905 .61428 m .11905 .61803 L s .16667 .61428 m .16667 .61803 L s .2619 .61428 m .2619 .61803 L s .30952 .61428 m .30952 .61803 L s .35714 .61428 m .35714 .61803 L s .45238 .61428 m .45238 .61803 L s .5 .61428 m .5 .61803 L s .54762 .61428 m .54762 .61803 L s .64286 .61428 m .64286 .61803 L s .69048 .61428 m .69048 .61803 L s .7381 .61428 m .7381 .61803 L s .83333 .61428 m .83333 .61803 L s .88095 .61428 m .88095 .61803 L s .92857 .61428 m .92857 .61803 L s .25 Mabswid 0 .61803 m 1 .61803 L s .99375 .06254 m 1 .06254 L s .99375 .1822 m 1 .1822 L s .99375 .30186 m 1 .30186 L s .99375 .42152 m 1 .42152 L s .99375 .54118 m 1 .54118 L s .125 Mabswid .99625 .08647 m 1 .08647 L s .99625 .1104 m 1 .1104 L s .99625 .13433 m 1 .13433 L s .99625 .15827 m 1 .15827 L s .99625 .20613 m 1 .20613 L s .99625 .23006 m 1 .23006 L s .99625 .25399 m 1 .25399 L s .99625 .27793 m 1 .27793 L s .99625 .32579 m 1 .32579 L s .99625 .34972 m 1 .34972 L s .99625 .37365 m 1 .37365 L s .99625 .39759 m 1 .39759 L s .99625 .44545 m 1 .44545 L s .99625 .46938 m 1 .46938 L s .99625 .49332 m 1 .49332 L s .99625 .51725 m 1 .51725 L s .99625 .03861 m 1 .03861 L s .99625 .01467 m 1 .01467 L s .99625 .56511 m 1 .56511 L s .99625 .58904 m 1 .58904 L s .99625 .61298 m 1 .61298 L s .25 Mabswid 1 0 m 1 .61803 L s 0 .06254 m 1 .06254 L s 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath 0 .58 1 r 2 Mabswid .02476 .07693 m .02571 .08552 L .02667 .09746 L .02762 .10247 L .02857 .10007 L .02952 .09307 L .03048 .08631 L .03143 .08163 L .03238 .07998 L .03333 .08858 L .03429 .0929 L .03524 .09369 L .03619 .09795 L .03714 .09733 L .0381 .09863 L .03905 .0982 L .04 .10563 L .04095 .10679 L .0419 .11907 L .04286 .13028 L .04381 .13733 L .04476 .14937 L .04571 .16029 L .04667 .16859 L .04762 .16853 L .04857 .16915 L .04952 .16276 L .05048 .1633 L .05143 .1671 L .05238 .16221 L .05333 .17137 L .05429 .17201 L .05524 .17698 L .05619 .17778 L .05714 .17877 L .0581 .18931 L .05905 .19953 L .06 .20899 L .06095 .20912 L .0619 .20584 L .06286 .20194 L .06381 .19426 L .06476 .19633 L .06571 .19681 L .06667 .18677 L .06762 .1817 L .06857 .17591 L .06952 .17913 L .07048 .187 L .07143 .18416 L Mistroke .07238 .18756 L .07333 .18983 L .07429 .19244 L .07524 .21075 L .07619 .22513 L .07714 .23527 L .0781 .2431 L .07905 .23937 L .08 .22914 L .08095 .21658 L .0819 .20768 L .08286 .20691 L .08381 .20829 L .08476 .21188 L .08571 .20789 L .08667 .19612 L .08762 .18361 L .08857 .18048 L .08952 .17983 L .09048 .18069 L .09143 .18891 L .09238 .19442 L .09333 .20054 L .09429 .21462 L .09524 .21717 L .09619 .23239 L .09714 .24523 L .0981 .26177 L .09905 .26699 L .1 .25712 L .10095 .24402 L .1019 .23218 L .10286 .23143 L .10381 .24115 L .10476 .25249 L .10571 .26181 L .10667 .28245 L .10762 .29355 L .10857 .30664 L .10952 .31148 L .11048 .30578 L .11143 .29722 L .11238 .29676 L .11333 .29101 L .11429 .29879 L .11524 .29883 L .11619 .30452 L .11714 .30765 L .1181 .3092 L .11905 .30793 L Mistroke .12 .31338 L .12095 .3131 L .1219 .31319 L .12286 .31443 L .12381 .30037 L .12476 .28015 L .12571 .27729 L .12667 .27108 L .12762 .2695 L .12857 .27185 L .12952 .26833 L .13048 .26437 L .13143 .26725 L .13238 .2588 L .13333 .25645 L .13429 .26196 L .13524 .26775 L .13619 .28902 L .13714 .31219 L .1381 .32735 L .13905 .33688 L .14 .33201 L .14095 .31234 L .1419 .29414 L .14286 .28408 L .14381 .28674 L .14476 .30051 L .14571 .30623 L .14667 .30563 L .14762 .30054 L .14857 .28498 L .14952 .27892 L .15048 .27161 L .15143 .26119 L .15238 .25029 L .15333 .22903 L .15429 .21326 L .15524 .21127 L .15619 .22772 L .15714 .24129 L .1581 .25415 L .15905 .25913 L .16 .25876 L .16095 .26181 L .1619 .26065 L .16286 .25811 L .16381 .25715 L .16476 .24647 L .16571 .24391 L .16667 .23977 L Mistroke .16762 .24354 L .16857 .25219 L .16952 .25494 L .17048 .24929 L .17143 .24128 L .17238 .23644 L .17333 .23447 L .17429 .24777 L .17524 .24928 L .17619 .24713 L .17714 .24438 L .1781 .23711 L .17905 .22196 L .18 .21517 L .18095 .2067 L .1819 .19745 L .18286 .1837 L .18381 .17835 L .18476 .18602 L .18571 .19297 L .18667 .21556 L .18762 .22646 L .18857 .22898 L .18952 .23822 L .19048 .24138 L .19143 .25583 L .19238 .25609 L .19333 .24398 L .19429 .23143 L .19524 .22614 L .19619 .22046 L .19714 .21094 L .1981 .1929 L .19905 .16902 L .2 .15765 L .20095 .1538 L .2019 .15487 L .20286 .15192 L .20381 .15099 L .20476 .15026 L .20571 .15403 L .20667 .15848 L .20762 .16834 L .20857 .17863 L .20952 .18414 L .21048 .18406 L .21143 .17973 L .21238 .18182 L .21333 .17715 L .21429 .17495 L Mistroke .21524 .16677 L .21619 .15117 L .21714 .15258 L .2181 .15484 L .21905 .15445 L .22 .15682 L .22095 .13885 L .2219 .11499 L .22286 .11177 L .22381 .11847 L .22476 .12367 L .22571 .13941 L .22667 .13907 L .22762 .13442 L .22857 .12314 L .22952 .11111 L .23048 .1006 L .23143 .09795 L .23238 .09229 L .23333 .09739 L .23429 .10728 L .23524 .12631 L .23619 .13926 L .23714 .14152 L .2381 .14169 L .23905 .1262 L .24 .11272 L .24095 .09518 L .2419 .07092 L .24286 .06433 L .24381 .0462 L .24476 .0356 L .24571 .04198 L .24667 .04627 L .24762 .05789 L .24857 .0627 L .24952 .06602 L .25048 .068 L .25143 .07553 L .25238 .0812 L .25333 .08019 L .25429 .0716 L .25524 .06606 L .25619 .0559 L .25714 .04829 L .2581 .03386 L .25905 .02139 L .26 .01482 L .26095 .01472 L .2619 .03158 L Mistroke .26286 .04065 L .26381 .04635 L .26476 .04849 L .26571 .05586 L .26667 .07359 L .26762 .09121 L .26857 .10955 L .26952 .12416 L .27048 .14435 L .27143 .16556 L .27238 .17155 L .27333 .18325 L .27429 .1812 L .27524 .18672 L .27619 .19819 L .27714 .20247 L .2781 .20844 L .27905 .20829 L .28 .20681 L .28095 .21117 L .2819 .213 L .28286 .20548 L .28381 .21018 L .28476 .21555 L .28571 .22374 L .28667 .24163 L .28762 .24273 L .28857 .24855 L .28952 .24607 L .29048 .24008 L .29143 .23037 L .29238 .21897 L .29333 .20448 L .29429 .2009 L .29524 .19165 L .29619 .18896 L .29714 .17595 L .2981 .1654 L .29905 .15497 L .3 .14597 L .30095 .15328 L .3019 .15954 L .30286 .17106 L .30381 .1761 L .30476 .18317 L .30571 .18883 L .30667 .1904 L .30762 .19149 L .30857 .19211 L .30952 .19785 L Mistroke .31048 .20182 L .31143 .19773 L .31238 .19616 L .31333 .19131 L .31429 .2015 L .31524 .2114 L .31619 .21661 L .31714 .21756 L .3181 .21527 L .31905 .21896 L .32 .2229 L .32095 .22269 L .3219 .20887 L .32286 .19431 L .32381 .17523 L .32476 .15375 L .32571 .14206 L .32667 .13186 L .32762 .12955 L .32857 .12818 L .32952 .12009 L .33048 .1269 L .33143 .13351 L .33238 .14334 L .33333 .14839 L .33429 .14393 L .33524 .13714 L .33619 .12613 L .33714 .12056 L .3381 .11837 L .33905 .11661 L .34 .12312 L .34095 .12973 L .3419 .14248 L .34286 .14461 L .34381 .14153 L .34476 .14065 L .34571 .14031 L .34667 .14893 L .34762 .16319 L .34857 .16737 L .34952 .1723 L .35048 .16871 L .35143 .17085 L .35238 .19291 L .35333 .20995 L .35429 .22227 L .35524 .21769 L .35619 .20955 L .35714 .20437 L Mistroke .3581 .20678 L .35905 .21727 L .36 .22307 L .36095 .22733 L .3619 .2303 L .36286 .24455 L .36381 .24451 L .36476 .24365 L .36571 .24013 L .36667 .22528 L .36762 .21961 L .36857 .21071 L .36952 .21977 L .37048 .21709 L .37143 .20873 L .37238 .19108 L .37333 .17229 L .37429 .14912 L .37524 .14517 L .37619 .14247 L .37714 .13776 L .3781 .1427 L .37905 .14103 L .38 .1379 L .38095 .13524 L .3819 .14371 L .38286 .14956 L .38381 .15816 L .38476 .16846 L .38571 .18212 L .38667 .20107 L .38762 .21708 L .38857 .2269 L .38952 .22552 L .39048 .21953 L .39143 .21285 L .39238 .20827 L .39333 .21217 L .39429 .21502 L .39524 .22434 L .39619 .23085 L .39714 .22936 L .3981 .22672 L .39905 .21992 L .4 .2291 L .40095 .23427 L .4019 .23976 L .40286 .23931 L .40381 .22597 L .40476 .21382 L Mistroke .40571 .20132 L .40667 .18812 L .40762 .18419 L .40857 .17574 L .40952 .17184 L .41048 .1652 L .41143 .15612 L .41238 .15368 L .41333 .1505 L .41429 .15547 L .41524 .16359 L .41619 .17916 L .41714 .18849 L .4181 .1969 L .41905 .20136 L .42 .19783 L .42095 .20021 L .4219 .20168 L .42286 .20139 L .42381 .20408 L .42476 .20103 L .42571 .20385 L .42667 .21079 L .42762 .22077 L .42857 .24073 L .42952 .25328 L .43048 .26142 L .43143 .26231 L .43238 .25323 L .43333 .25446 L .43429 .25894 L .43524 .26572 L .43619 .26735 L .43714 .2704 L .4381 .26935 L .43905 .27328 L .44 .26975 L .44095 .26967 L .4419 .26502 L .44286 .25818 L .44381 .25776 L .44476 .25869 L .44571 .26295 L .44667 .26551 L .44762 .26451 L .44857 .27088 L .44952 .27113 L .45048 .27029 L .45143 .27119 L .45238 .26905 L Mistroke .45333 .27907 L .45429 .28614 L .45524 .28084 L .45619 .27682 L .45714 .26983 L .4581 .27383 L .45905 .27952 L .46 .28864 L .46095 .30279 L .4619 .31808 L .46286 .34166 L .46381 .35528 L .46476 .37027 L .46571 .37721 L .46667 .37197 L .46762 .3691 L .46857 .36802 L .46952 .37255 L .47048 .38493 L .47143 .39101 L .47238 .40212 L .47333 .40663 L .47429 .4058 L .47524 .41886 L .47619 .42963 L .47714 .44668 L .4781 .45953 L .47905 .47526 L .48 .47647 L .48095 .48977 L .4819 .49801 L .48286 .50236 L .48381 .50357 L .48476 .5122 L .48571 .50149 L .48667 .48893 L .48762 .47984 L .48857 .4723 L .48952 .47769 L .49048 .4857 L .49143 .49486 L .49238 .51206 L .49333 .52118 L .49429 .53646 L .49524 .53784 L .49619 .53607 L .49714 .54256 L .4981 .54944 L .49905 .54949 L .5 .54889 L Mistroke .50095 .54748 L .5019 .55512 L .50286 .55928 L .50381 .56401 L .50476 .56919 L .50571 .57206 L .50667 .58507 L .50762 .58877 L .50857 .59496 L .50952 .59845 L .51048 .5803 L .51143 .56864 L .51238 .55536 L .51333 .53835 L .51429 .52877 L .51524 .51819 L .51619 .51272 L .51714 .50378 L .5181 .48462 L .51905 .47528 L .52 .46581 L .52095 .46647 L .5219 .46717 L .52286 .46559 L .52381 .45937 L .52476 .45944 L .52571 .45616 L .52667 .4456 L .52762 .43469 L .52857 .42017 L .52952 .4015 L .53048 .39257 L .53143 .38929 L .53238 .39821 L .53333 .40425 L .53429 .41294 L .53524 .41381 L .53619 .4106 L .53714 .41103 L .5381 .40799 L .53905 .40504 L .54 .40159 L .54095 .39502 L .5419 .38463 L .54286 .37156 L .54381 .36892 L .54476 .35715 L .54571 .35646 L .54667 .34902 L .54762 .34899 L Mistroke .54857 .34874 L .54952 .34661 L .55048 .35557 L .55143 .35939 L .55238 .37484 L .55333 .39085 L .55429 .40462 L .55524 .40913 L .55619 .42314 L .55714 .43168 L .5581 .44372 L .55905 .46439 L .56 .47033 L .56095 .47238 L .5619 .46985 L .56286 .46273 L .56381 .46906 L .56476 .48012 L .56571 .48497 L .56667 .4788 L .56762 .47548 L .56857 .47175 L .56952 .47386 L .57048 .47246 L .57143 .46996 L .57238 .46625 L .57333 .45811 L .57429 .45592 L .57524 .46055 L .57619 .45774 L .57714 .44804 L .5781 .44553 L .57905 .43318 L .58 .42069 L .58095 .41332 L .5819 .41441 L .58286 .41471 L .58381 .42694 L .58476 .43266 L .58571 .43346 L .58667 .43168 L .58762 .43868 L .58857 .45058 L .58952 .46051 L .59048 .47302 L .59143 .48708 L .59238 .498 L .59333 .51378 L .59429 .51217 L .59524 .5072 L Mistroke .59619 .5061 L .59714 .50061 L .5981 .49889 L .59905 .48995 L .6 .47598 L .60095 .46415 L .6019 .449 L .60286 .44983 L .60381 .4577 L .60476 .46639 L .60571 .46675 L .60667 .46677 L .60762 .46612 L .60857 .47403 L .60952 .48521 L .61048 .49875 L .61143 .50756 L .61238 .51273 L .61333 .50987 L .61429 .51387 L .61524 .51401 L .61619 .52163 L .61714 .52453 L .6181 .52323 L .61905 .51705 L .62 .50841 L .62095 .50607 L .6219 .51098 L .62286 .52208 L .62381 .5229 L .62476 .51623 L .62571 .51684 L .62667 .51456 L .62762 .52005 L .62857 .52174 L .62952 .52337 L .63048 .51954 L .63143 .51883 L .63238 .50963 L .63333 .51013 L .63429 .49939 L .63524 .49815 L .63619 .49717 L .63714 .49801 L .6381 .4984 L .63905 .50691 L .64 .51789 L .64095 .52732 L .6419 .5363 L .64286 .53946 L Mistroke .64381 .5309 L .64476 .52976 L .64571 .52757 L .64667 .53228 L .64762 .54895 L .64857 .5664 L .64952 .5818 L .65048 .58575 L .65143 .59271 L .65238 .59525 L .65333 .60133 L .65429 .60275 L .65524 .59927 L .65619 .59312 L .65714 .59155 L .6581 .57875 L .65905 .56884 L .66 .55731 L .66095 .5482 L .6619 .5262 L .66286 .51971 L .66381 .50832 L .66476 .52479 L .66571 .53777 L .66667 .54307 L .66762 .54636 L .66857 .54818 L .66952 .54471 L .67048 .54608 L .67143 .54451 L .67238 .54301 L .67333 .55023 L .67429 .56172 L .67524 .5831 L .67619 .59891 L .67714 .60332 L .6781 .59813 L .67905 .58594 L .68 .56779 L .68095 .56447 L .6819 .56496 L .68286 .56565 L .68381 .5766 L .68476 .57415 L .68571 .56551 L .68667 .56583 L .68762 .56259 L .68857 .56958 L .68952 .57546 L .69048 .58269 L Mistroke .69143 .57114 L .69238 .55062 L .69333 .53003 L .69429 .50341 L .69524 .48077 L .69619 .46381 L .69714 .45223 L .6981 .43496 L .69905 .41467 L .7 .39958 L .70095 .37887 L .7019 .37425 L .70286 .36952 L .70381 .36405 L .70476 .34938 L .70571 .32977 L .70667 .30821 L .70762 .29703 L .70857 .29426 L .70952 .29368 L .71048 .29397 L .71143 .30333 L .71238 .31504 L .71333 .32737 L .71429 .33388 L .71524 .33213 L .71619 .32783 L .71714 .327 L .7181 .33077 L .71905 .34163 L .72 .36227 L .72095 .37264 L .7219 .38016 L .72286 .37659 L .72381 .37406 L .72476 .36344 L .72571 .34822 L .72667 .33262 L .72762 .31294 L .72857 .30652 L .72952 .30382 L .73048 .30034 L .73143 .29689 L .73238 .28946 L .73333 .28571 L .73429 .27829 L .73524 .27391 L .73619 .26987 L .73714 .26655 L .7381 .27157 L Mistroke .73905 .27397 L .74 .26676 L .74095 .26253 L .7419 .25729 L .74286 .24988 L .74381 .25571 L .74476 .25549 L .74571 .25628 L .74667 .25828 L .74762 .25297 L .74857 .25779 L .74952 .26082 L .75048 .25764 L .75143 .25339 L .75238 .25165 L .75333 .2529 L .75429 .2619 L .75524 .27369 L .75619 .2783 L .75714 .27461 L .7581 .26012 L .75905 .24584 L .76 .24024 L .76095 .23643 L .7619 .23151 L .76286 .23012 L .76381 .21956 L .76476 .21743 L .76571 .21437 L .76667 .22399 L .76762 .21886 L .76857 .21398 L .76952 .20809 L .77048 .19498 L .77143 .19067 L .77238 .18519 L .77333 .17362 L .77429 .17209 L .77524 .18331 L .77619 .1885 L .77714 .19632 L .7781 .19631 L .77905 .20055 L .78 .21147 L .78095 .21746 L .7819 .22822 L .78286 .23105 L .78381 .237 L .78476 .25713 L .78571 .27544 L Mistroke .78667 .30129 L .78762 .31326 L .78857 .3282 L .78952 .33129 L .79048 .34307 L .79143 .35672 L .79238 .35828 L .79333 .36267 L .79429 .35341 L .79524 .34739 L .79619 .34552 L .79714 .33814 L .7981 .3317 L .79905 .31751 L .8 .30144 L .80095 .28648 L .8019 .28786 L .80286 .28967 L .80381 .29194 L .80476 .29031 L .80571 .2911 L .80667 .2877 L .80762 .28857 L .80857 .29437 L .80952 .30454 L .81048 .3176 L .81143 .33341 L .81238 .34999 L .81333 .3483 L .81429 .34329 L .81524 .34351 L .81619 .34758 L .81714 .3595 L .8181 .37365 L .81905 .38849 L .82 .38141 L .82095 .38001 L .8219 .37198 L .82286 .36499 L .82381 .36671 L .82476 .36855 L .82571 .37842 L .82667 .37767 L .82762 .38207 L .82857 .37514 L .82952 .36313 L .83048 .3613 L .83143 .35311 L .83238 .34139 L .83333 .33442 L Mistroke .83429 .32908 L .83524 .33492 L .83619 .33283 L .83714 .33675 L .8381 .33106 L .83905 .32809 L .84 .32243 L .84095 .31472 L .8419 .29997 L .84286 .28652 L .84381 .28295 L .84476 .2877 L .84571 .30294 L .84667 .31819 L .84762 .33219 L .84857 .3392 L .84952 .35492 L .85048 .36048 L .85143 .37516 L .85238 .38725 L .85333 .39038 L .85429 .38383 L .85524 .36396 L .85619 .34559 L .85714 .32986 L .8581 .32332 L .85905 .3193 L .86 .31888 L .86095 .31023 L .8619 .31353 L .86286 .31428 L .86381 .32905 L .86476 .3478 L .86571 .35844 L .86667 .36233 L .86762 .36349 L .86857 .36007 L .86952 .34583 L .87048 .33369 L .87143 .31831 L .87238 .30388 L .87333 .29891 L .87429 .29862 L .87524 .3003 L .87619 .30216 L .87714 .29931 L .8781 .29337 L .87905 .29878 L .88 .31331 L .88095 .32848 L Mistroke .8819 .33807 L .88286 .33783 L .88381 .33766 L .88476 .33953 L .88571 .33677 L .88667 .33529 L .88762 .33659 L .88857 .34004 L .88952 .349 L .89048 .35382 L .89143 .35863 L .89238 .35641 L .89333 .35177 L .89429 .34072 L .89524 .32278 L .89619 .3081 L .89714 .29922 L .8981 .30129 L .89905 .29744 L .9 .2994 L .90095 .28531 L .9019 .27266 L .90286 .25291 L .90381 .2481 L .90476 .24569 L .90571 .24244 L .90667 .24816 L .90762 .24971 L .90857 .2575 L .90952 .26781 L .91048 .27644 L .91143 .28407 L .91238 .28891 L .91333 .29209 L .91429 .29206 L .91524 .28199 L .91619 .2779 L .91714 .27523 L .9181 .27891 L .91905 .29304 L .92 .30557 L .92095 .31291 L .9219 .32292 L .92286 .32466 L .92381 .33644 L .92476 .33792 L .92571 .33477 L .92667 .33046 L .92762 .32459 L .92857 .32375 L Mistroke .92952 .32662 L .93048 .33564 L .93143 .34899 L .93238 .36932 L .93333 .39098 L .93429 .41333 L .93524 .43198 L .93619 .43875 L .93714 .45196 L .9381 .44757 L .93905 .43458 L .94 .4282 L .94095 .42486 L .9419 .42335 L .94286 .42449 L .94381 .42367 L .94476 .41707 L .94571 .41255 L .94667 .41573 L .94762 .41649 L .94857 .42798 L .94952 .44277 L .95048 .45219 L .95143 .46707 L .95238 .47534 L .95333 .48722 L .95429 .48793 L .95524 .49524 L .95619 .4936 L .95714 .49258 L .9581 .49075 L .95905 .47803 L .96 .4613 L .96095 .44864 L .9619 .44095 L .96286 .43487 L .96381 .43407 L .96476 .42171 L .96571 .40733 L .96667 .39534 L .96762 .38505 L .96857 .38015 L .96952 .3826 L .97048 .37986 L .97143 .38362 L .97238 .38271 L .97333 .39164 L .97429 .39249 L .97524 .40371 L .97619 .4089 L Mistroke Mfstroke % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{288, 177.938}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHg7oo1@9O0Woo0P9O`Woo00<007ooOol017oo000? Ool00`00Oomoo`02Ool40UlfOol20Ul00goo0Ul2G`02Ool20Uo2Ool00`00Oomoo`04Ool000moo`03 001oogoo009oo`@2GcIoo`82G`03Ool2G`9O009oo`82Gl9oo`03001oogoo00Aoo`003goo0P0017oo 109O=Goo0P9O00=oo`9O0Ul00Woo0P9O`Goo0P001Woo000?Ool00`00Oomoo`03Ool40UleOol20Ul5 Ool20Uo2Ool00`00Oomoo`04Ool000moo`03001oogoo00=oo`@2Gc=oo`@2G`Eoo`82Gl9oo`03001o ogoo00Aoo`003goo00<007ooOol00goo1@9Ogoo 00<007ooOol017oo0002Ool00`00Oomoo`02Ool01000Oomoo`0017oo00<007ooOol02Woo0`9O00=o o`9O0Ul07Goo0P9O0Woo1P9O3Goo0P9O1Goo109O0goo0P9O1Goo0P9O17oo0P9O00=oo`9O0Ul01Goo 109OGGoo0P9O>goo00<007ooOol017oo0002Ool00`00Oomoo`02Ool01000Oomoo`0017oo0P0037oo 0P9O00=oo`9O0Ul00goo0`9O5goo0P9O0Woo1P9O3Goo0`9O17oo109O0goo0P9O1Goo0P9O17oo0P9O 00=oo`9O0Ul01Goo109OG7oo0`9O>Goo0`001Woo0002Ool00`00Oomoo`02Ool01000Oomoo`0017oo 00<007ooOol02goo0P9O00Aoo`9O0Ul2G`9oo`<2GaIoo`<2G`9oo`D2G`moo`82G`Aoo`@2G`=oo`82 G`Eoo`<2G`=oo`82G`03Ool2G`9O00Aoo`D2Geaoo`<2Gc]oo`03001oogoo00Aoo`000Woo00<007oo Ool00Woo00@007ooOol000Aoo`03001oogoo00]oo`82G`04Ool2G`9O0Ul2Ool30UlFOol30Ul2Ool2 0Ul00goo0Ul2G`0?Ool20Ul4Ool40Ul3Ool20Ul6Ool20Ul3Ool20Ul00goo0Ul2G`04Ool20Ul00goo 0Ul2G`1LOol30UlkOol00`00Oomoo`04Ool00003Ool0000000Eoo`8000Eoo`03001oogoo00]oo`82 G`03Ool2G`9O0082G`04Ool2G`9O0UlFOol30Ul2Ool20UlBOol20Ul3Ool70Ul00goo0Ul2G`06Ool2 0Ul3Ool20Ul017oo0Ul2G`9O0goo0P9O00=oo`9O0Ul0G7oo0`9O>goo00<007ooOol017oo000?Ool0 0`00Oomoo`0;Ool70Ul017oo0Ul2G`9O5Woo0`9O0Woo0P9O4Woo0P9O0goo0P9O00=oo`9O0Ul00P9O 00=oo`9O0Ul01Woo0P9O0goo0P9O0Woo0P9O0goo0P9O00=oo`9O0Ul0G7oo109O>Woo00<007ooOol0 17oo000?Ool00`00Oomoo`0Woo 00<007ooOol017oo000?Ool00`00Oomoo`0Goo0P001Woo000?Ool00`00Oomoo`0Ool20Ul5Ool30Ul00goo 0Ul2G`0DOol30Ul00goo0Ul2G`03Ool40Ul7Ool30Ul017oo0Ul2G`9O0Woo0`9O00Aoo`9O0Ul2G`=o o`82GeYoo`@2GcYoo`03001oogoo00Aoo`003goo00<007ooOol037oo0P9O0Woo109O00=oo`9O0Ul0 3Woo0P9O1Goo0`9O00=oo`9O0Ul05Goo1@9O17oo0`9O1goo0`9O00Aoo`9O0Ul2G`9oo`H2G`Aoo`82 GeUoo`D2GcYoo`03001oogoo00Aoo`003goo00<007ooOol047oo0`9O0Woo0P9O3Woo0P9O1Goo0`9O 00=oo`9O0Ul05Goo1@9O17oo0`9O1goo0`9O00Aoo`9O0Ul2G`9oo`H2G`Aoo`<2GeMoo`<2G`04Ool2 G`9O0UliOol00`00Oomoo`04Ool000moo`03001oogoo011oo`<2G`9oo`82G`ioo`82G`Aoo`L2GaIo o`@2G`Aoo`<2G`Moo`H2G`=oo`H2G`Eoo`82GeMoo`<2G`9oo`82GcUoo`03001oogoo00Aoo`003goo 00<007ooOol047oo0`9O0Woo0P9O3Woo0P9O17oo0P9O00=oo`9O0Ul00P9O5Woo109O1Goo0P9O1goo 1P9O0goo1P9O1Goo0P9OEgoo0`9O0Woo0P9O>Goo00<007ooOol017oo000?Ool2000AOol30Ul2Ool2 0Ul>Ool20Ul4Ool20Ul00goo0Ul2G`020UlFOol30UlAOol30Ul4Ool60Ul5Ool20UmGOol30Ul2Ool2 0UlhOol20006Ool000moo`03001oogoo011oo`<2G`9oo`@2G`aoo`82G`=oo`<2G`03Ool2G`9O0082 GaIoo`<2Ga5oo`<2G`Ioo`@2G`Eoo`82GeIoo`<2G`=oo`82GcUoo`03001oogoo00Aoo`003goo00<0 07ooOol047oo0`9O0Woo109O37oo0`9O0Woo0`9O00=oo`9O0Ul00P9O5Woo0`9O4Goo0`9O1goo0`9O 1Goo0P9OEWoo0P9O17oo0P9O>Goo00<007ooOol017oo000?Ool00`00Oomoo`0@Ool30Ul2Ool40Ul< Ool80Ul00goo0Ul2G`020UlFOol30UlAOol30Ul7Ool30Ul5Ool20UmFOol20Ul4Ool20UlOOol20UlH Ool00`00Oomoo`04Ool000moo`03001oogoo011oo`<2G`=oo`<2G`]oo`T2G`04Ool2G`9O0UlGOol3 0UlAOol30Ul8Ool20Ul5Ool20UmFOol20Ul4Ool20UlNOol30UlHOol00`00Oomoo`04Ool000moo`03 001oogoo015oo`82G`=oo`@2G`Yoo`T2G`04Ool2G`9O0UlGOol30UlAOol30Ul?Ool20UmAOol20Ul3 Ool20Ul4Ool30UlMOol30UlHOol00`00Oomoo`04Ool000moo`03001oogoo01Ioo`@2G`Yoo`T2G`04 Ool2G`9O0UlHOol20UlSOol30Um@Ool70Ul5Ool20UlMOol30UlHOol00`00Oomoo`04Ool000moo`80 01Moo`@2G`Eoo`82G`=oo`L2G`Aoo`82Gceoo`<2Ge1oo`L2G`Eoo`82Gaeoo`@2GaIoo`8000Ioo`00 3goo00<007ooOol05Woo109O1Goo0P9O0goo1`9O17oo0P9O?Goo0`9O00=oo`9O0Ul0CGoo1P9O1Woo 0P9O7Goo109O5goo00<007ooOol017oo000?Ool00`00Oomoo`0FOol40Ul5Ool30Ul2Ool50Um5Ool7 0UmOol40Um7Ool20Ul4Ool20Ul6 Ool20Ul=Ool20Ul=Ool70UlEOol00`00Oomoo`04Ool000moo`03001oogoo01Qoo`82G`=oo`82G`03 Ool2G`9O00@2Gdioo`@2GdMoo`82G`aoo`82G`9oo`82G`Uoo`82G`eoo`82G`03Ool2G`9O0082GaEo o`03001oogoo00Aoo`003goo00<007ooOol067oo109O00Aoo`9O0Umoo`D2Ge1oo`<2GdMoo`82G`ao o`82G`9oo`@2G`Moo`<2G`aoo`82G`03Ool2G`9O0082GaEoo`03001oogoo00Aoo`0000=oo`000000 0P000goo0P001Goo00<007ooOol067oo109O00Aoo`9O0Umoo`D2Ge5oo`82Gd1oo`<2G`Aoo`82G`ao o`82G`9oo`@2G`Moo`<2G`Ioo`82G`Aoo`82G`9oo`<2GaEoo`03001oogoo00Aoo`000Woo00<007oo Ool00Woo00@007ooOol000Aoo`03001oogoo01Qoo`@2G`04Ool2G`9OOol50UmAOol20Um0Ool30Ul3 Ool30UlOol20Ul017oo0Ul2Ggoo0P9O1goo0`9O00Eoo`9O0Ul2Ggoo00@2G`9oo`82G`Eoo`82 GaAoo`03001oogoo00Aoo`003goo00<007ooOol087oo0`9OE7oo0P9O?goo109O00=oo`9O0Ul03Woo 1@9O00=oo`9O0Ul01Woo109O00Eoo`9O0Ul2Ggoo00@2G`9oo`82G`Eoo`@2Ga9oo`03001oogoo00Ao o`003goo0P008Woo0P9OE7oo0P9O?goo1`9O3goo109O00Aoo`9O0Ul2G`Eoo`@2G`03Ool2G`9O00H2 G`9oo`82G`Eoo`@2Ga5oo`8000Ioo`003goo00<007ooOol08Goo0P9OE7oo0P9O?goo1`9O3goo109O 0Woo0P9O17oo1@9O00=oo`9O0Ul01P9O0Woo0P9O1Goo109O4Woo00<007ooOol017oo000?Ool00`00 Oomoo`0QOol20UmDOol20UloOol70Ul?Ool40Ul2Ool20Ul3Ool60Ul00goo0Ul2G`030Ul00goo0Ul2 G`040Ul6Ool30UlBOol00`00Oomoo`04Ool000moo`03001oogoo025oo`82GeAoo`82Gcmoo`L2G`mo o`@2G`9oo`82G`=oo``2G`03Ool2G`9O00@2G`Ioo`<2Ga9oo`03001oogoo00Aoo`003goo00<007oo Ool08Goo0P9OE7oo0P9O?Woo0`9O00=oo`9O0Ul00P9O3goo109O0Woo0`9O0Woo109O00=oo`9O0Ul0 1@9O00=oo`9O0Ul0109O1Woo0`9O4Woo00<007ooOol017oo000?Ool00`00Oomoo`1gOol20UlEOol2 0UlWOol20Ul2Ool40Ul?Ool40Ul2Ool30Ul2Ool20Ul3Ool70Ul3Ool40Ul7Ool30UlAOol00`00Oomo o`04Ool000moo`8007Qoo`82GaAoo`<2GbMoo`82G`9oo`@2G`moo`@2G`9oo`<2G`9oo`82G`=oo`L2 G`=oo`@2G`Qoo`82Ga1oo`8000Ioo`003goo00<007ooOol0Mgoo0P9O57oo0`9O9goo0P9O0Woo109O 3goo0`9O0goo0`9O0Woo0P9O0goo1`9O0goo0`9O2Goo0P9O4Goo00<007ooOol017oo000?Ool00`00 Oomoo`1gOol20UlDOol30UlWOol20Ul2Ool40Ul?Ool30Ul4Ool20Ul2Ool20Ul3Ool70Ul4Ool20Ul9 Ool20UlAOol00`00Oomoo`04Ool000moo`03001oogoo07Moo`82GaAoo`@2GbIoo`82G`9oo`@2G`mo o`<2G`Aoo`82G`9oo`82G`=oo`<2G`04Ool2G`9O0Ul4Ool20Ul9Ool20UlAOol00`00Oomoo`04Ool0 00moo`03001oogoo07Moo`82Ga=oo`D2GbIoo`82G`9oo`@2Ga1oo`82G`Aoo`H2G`=oo`<2G`04Ool2 G`9O0Ul?Ool20UlAOol00`00Oomoo`04Ool000moo`03001oogoo07Moo`<2Ga9oo`82G`03Ool2G`9O 02Ioo`82G`9oo`@2GaIoo`D2G`Aoo`<2G`9oo`82G`moo`82Ga5oo`03001oogoo00Aoo`003goo0P00 N7oo109O4Goo0P9O00=oo`9O0Ul09Woo0P9O0goo0`9O5Woo1@9O17oo0`9O4goo0P9O47oo0P001Woo 000?Ool00`00Oomoo`1gOol40UlAOol20Ul00goo0Ul2G`0VOol20Ul3Ool20UlGOol50Ul4Ool30UlC Ool20UlAOol00`00Oomoo`04Ool000moo`03001oogoo07Qoo`<2Ga5oo`82G`03Ool2G`9O02Eoo`<2 G`=oo`82GaMoo`D2G`Aoo`<2Ga=oo`82G`Moo`<2G`Moo`03001oogoo00Aoo`003goo00<007ooOol0 NGoo0P9O4Goo0P9O00=oo`9O0Ul09Goo0P9O17oo0P9O5goo1@9O17oo0`9O4goo0P9O1goo0`9O1goo 00<007ooOol017oo000?Ool00`00Oomoo`1iOol20UlAOol20Ul00goo0Ul2G`0UOol20UlNOol40Ul5 Ool20UlCOol20Ul7Ool30Ul7Ool00`00Oomoo`04Ool000moo`03001oogoo07Uoo`82G`ioo`82G`04 Ool2G`9OOol20UlUOol20UlNOol20Ul7Ool20UlCOol20Ul7Ool40Ul6Ool00`00Oomoo`04Ool000mo o`03001oogoo07Uoo`82G`ioo`82G`04Ool2G`9OOol20UlUOol20UlWOol20UlCOol20Ul7Ool40Ul6 Ool00`00Oomoo`04Ool000moo`8007Yoo`82G`ioo`82G`04Ool2G`9OOol20UlUOol20UllOol20Ul7 Ool40Ul5Ool20006Ool000moo`03001oogoo07Uoo`82G`ioo`D2G`03Ool2G`9O02Eoo`82Gcaoo`82 G`Moo`@2G`Ioo`03001oogoo00Aoo`003goo00<007ooOol0NGoo0`9O3Goo109O0Woo0P9O9Goo0P9O ?7oo0P9O1goo109O1Woo00<007ooOol017oo000?Ool00`00Oomoo`1jOol20Ul=Ool40Ul2Ool30UlT Ool20UllOol20Ul7Ool50Ul5Ool00`00Oomoo`04Ool00004Ool000000004Ool20005Ool00`00Oomo o`1jOol20Ul"], ImageRangeCache->{{{0, 287}, {176.938, 0}} -> {-85.4975, -9.13181, 3.94728, 0.314166}}], Cell[BoxData[ RowBox[{"{", RowBox[{\(0.25`\ Second\), ",", TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]}], "}"}]], "Output"] }, Open ]], Cell["\<\ Amazingly, this function is linear in the length of the series to \ be created. Not many other functions manage that!\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(timingtesttable = Table[Timing[ ARMAList[1000\ i, 0, 0.5, {0.9, 0.09}, {0.8, 0.8, 0.5}]; ], {i, 1, 30}]\)], "Input"], Cell[BoxData[ \({{0.149999999999636202`\ Second, Null}, {0.333333333333030168`\ Second, Null}, {0.483333333333575865`\ Second, Null}, { 0.650000000000545696`\ Second, Null}, {0.799999999999272404`\ Second, Null}, {0.96666666666715173`\ Second, Null}, { 1.11666666666678793`\ Second, Null}, {1.2999999999992724`\ Second, Null}, {1.48333333333357586`\ Second, Null}, { 1.60000000000036379`\ Second, Null}, {1.78333333333284826`\ Second, Null}, {1.98333333333357586`\ Second, Null}, { 2.13333333333321206`\ Second, Null}, {2.28333333333375776`\ Second, Null}, {2.43333333333339396`\ Second, Null}, { 2.6499999999996362`\ Second, Null}, {2.78333333333375776`\ Second, Null}, {2.9499999999998181`\ Second, Null}, { 3.21666666666624223`\ Second, Null}, {3.23333333333357586`\ Second, Null}, {3.43333333333339396`\ Second, Null}, { 3.6499999999996362`\ Second, Null}, {3.76666666666733362`\ Second, Null}, {3.96666666666624223`\ Second, Null}, { 4.10000000000036379`\ Second, Null}, {4.26666666666642413`\ Second, Null}, {4.4499999999998181`\ Second, Null}, { 4.61666666666678793`\ Second, Null}, {4.81666666666660603`\ Second, Null}, {4.9499999999998181`\ Second, Null}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ListPlot[\((First/@timingtesttable)\)/Second]\)], "Input"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.0238095 0.031746 0.0147151 0.11891 [ [.18254 .00222 -3 -9 ] [.18254 .00222 3 0 ] [.34127 .00222 -6 -9 ] [.34127 .00222 6 0 ] [.5 .00222 -6 -9 ] [.5 .00222 6 0 ] [.65873 .00222 -6 -9 ] [.65873 .00222 6 0 ] [.81746 .00222 -6 -9 ] [.81746 .00222 6 0 ] [.97619 .00222 -6 -9 ] [.97619 .00222 6 0 ] [.01131 .13362 -6 -4.5 ] [.01131 .13362 0 4.5 ] [.01131 .25253 -6 -4.5 ] [.01131 .25253 0 4.5 ] [.01131 .37144 -6 -4.5 ] [.01131 .37144 0 4.5 ] [.01131 .49035 -6 -4.5 ] [.01131 .49035 0 4.5 ] [.01131 .60926 -6 -4.5 ] [.01131 .60926 0 4.5 ] [ 0 0 0 0 ] [ 1 .61803 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid [ ] 0 setdash .18254 .01472 m .18254 .02097 L s [(5)] .18254 .00222 0 1 Mshowa .34127 .01472 m .34127 .02097 L s [(10)] .34127 .00222 0 1 Mshowa .5 .01472 m .5 .02097 L s [(15)] .5 .00222 0 1 Mshowa .65873 .01472 m .65873 .02097 L s [(20)] .65873 .00222 0 1 Mshowa .81746 .01472 m .81746 .02097 L s [(25)] .81746 .00222 0 1 Mshowa .97619 .01472 m .97619 .02097 L s [(30)] .97619 .00222 0 1 Mshowa .125 Mabswid .05556 .01472 m .05556 .01847 L s .0873 .01472 m .0873 .01847 L s .11905 .01472 m .11905 .01847 L s .15079 .01472 m .15079 .01847 L s .21429 .01472 m .21429 .01847 L s .24603 .01472 m .24603 .01847 L s .27778 .01472 m .27778 .01847 L s .30952 .01472 m .30952 .01847 L s .37302 .01472 m .37302 .01847 L s .40476 .01472 m .40476 .01847 L s .43651 .01472 m .43651 .01847 L s .46825 .01472 m .46825 .01847 L s .53175 .01472 m .53175 .01847 L s .56349 .01472 m .56349 .01847 L s .59524 .01472 m .59524 .01847 L s .62698 .01472 m .62698 .01847 L s .69048 .01472 m .69048 .01847 L s .72222 .01472 m .72222 .01847 L s .75397 .01472 m .75397 .01847 L s .78571 .01472 m .78571 .01847 L s .84921 .01472 m .84921 .01847 L s .88095 .01472 m .88095 .01847 L s .9127 .01472 m .9127 .01847 L s .94444 .01472 m .94444 .01847 L s .25 Mabswid 0 .01472 m 1 .01472 L s .02381 .13362 m .03006 .13362 L s [(1)] .01131 .13362 1 0 Mshowa .02381 .25253 m .03006 .25253 L s [(2)] .01131 .25253 1 0 Mshowa .02381 .37144 m .03006 .37144 L s [(3)] .01131 .37144 1 0 Mshowa .02381 .49035 m .03006 .49035 L s [(4)] .01131 .49035 1 0 Mshowa .02381 .60926 m .03006 .60926 L s [(5)] .01131 .60926 1 0 Mshowa .125 Mabswid .02381 .0385 m .02756 .0385 L s .02381 .06228 m .02756 .06228 L s .02381 .08606 m .02756 .08606 L s .02381 .10984 m .02756 .10984 L s .02381 .15741 m .02756 .15741 L s .02381 .18119 m .02756 .18119 L s .02381 .20497 m .02756 .20497 L s .02381 .22875 m .02756 .22875 L s .02381 .27632 m .02756 .27632 L s .02381 .3001 m .02756 .3001 L s .02381 .32388 m .02756 .32388 L s .02381 .34766 m .02756 .34766 L s .02381 .39523 m .02756 .39523 L s .02381 .41901 m .02756 .41901 L s .02381 .44279 m .02756 .44279 L s .02381 .46657 m .02756 .46657 L s .02381 .51414 m .02756 .51414 L s .02381 .53792 m .02756 .53792 L s .02381 .5617 m .02756 .5617 L s .02381 .58548 m .02756 .58548 L s .25 Mabswid .02381 0 m .02381 .61803 L s 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath .008 w .05556 .03255 Mdot .0873 .05435 Mdot .11905 .07219 Mdot .15079 .09201 Mdot .18254 .10984 Mdot .21429 .12966 Mdot .24603 .1475 Mdot .27778 .1693 Mdot .30952 .1911 Mdot .34127 .20497 Mdot .37302 .22677 Mdot .40476 .25055 Mdot .43651 .26839 Mdot .46825 .28623 Mdot .5 .30406 Mdot .53175 .32983 Mdot .56349 .34568 Mdot .59524 .3655 Mdot .62698 .39721 Mdot .65873 .39919 Mdot .69048 .42297 Mdot .72222 .44874 Mdot .75397 .46261 Mdot .78571 .48639 Mdot .81746 .50225 Mdot .84921 .52206 Mdot .88095 .54386 Mdot .9127 .56368 Mdot .94444 .58746 Mdot .97619 .60332 Mdot % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{288, 177.938}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHgGoo00<007oo Ool09Woo00<007ooOol00Woo00@007ooOol0025oo`03001oogoo009oo`03001oogoo029oo`04001o ogoo0002Ool01000Oomoo`008Goo00@007ooOol0009oo`03001oogoo02Eoo`04001oogoo0002Ool0 0`00Oomoo`08Ool003Uoo`@002Aoo`8000Eoo`80025oo`8000Aoo`@0029oo`8000Aoo`8002=oo`80 00=oo`@0025oo`<000Aoo`8000]oo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol> Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000:Oooo000?0008Ool0011o o`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Io o`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Io o`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Eo o`03001oogoo00Ioo`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Eo o`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Io o`03001oogoo00Eoo`03001oogoo00Ioo`03001oogoo00Ioo`03001oogoo00Eoo`03001oogoo00Io o`03001oogoo00aoo`0047oo00<007ooOol0:7oo00<007ooOol0:7oo00<007ooOol09goo00<007oo Ool0:7oo00<007ooOol0:7oo00<007ooOol0:7oo00<007ooOol037oo000@Ool00`00Oomoo`3oOol> Ool0011oo`03001oogoo00Eoo`800?moo`Moo`0047oo00<007ooOol01Goo0P00ogoo1goo000@Ool2 003oOol?Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomo o`3oOol>Ool0011oo`03001oogoo00ioo`800?eoo`0047oo00<007ooOol03Woo0P00oGoo000@Ool0 0`00Oomoo`3oOol>Ool0011oo`800?moo`moo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomo o`0FOol2003eOol0011oo`03001oogoo01Ioo`800?Eoo`0047oo00<007ooOol0ogoo3Woo000@Ool0 0`00Oomoo`3oOol>Ool0011oo`800?moo`moo`0047oo00<007ooOol07goo0P00k7oo000@Ool00`00 Oomoo`0OOol2003/Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool0 0`00Oomoo`3oOol>Ool0011oo`03001oogoo02Moo`800>Aoo`0047oo0P00:7oo0P00i7oo000@Ool0 0`00Oomoo`3oOol>Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo0008Ool3 0005Ool00`00Oomoo`0`Ool2003KOol000Uoo`03001oogoo00Aoo`03001oogoo031oo`800=]oo`00 2Goo00<007ooOol017oo0`00ogoo3Woo0009Ool00`00Oomoo`04Ool00`00Oomoo`3oOol>Ool000Uo o`03001oogoo00Aoo`03001oogoo0?moo`ioo`0027oo0P001Woo00<007ooOol0>Goo0P00dWoo000@ Ool00`00Oomoo`0iOol2003BOol0011oo`03001oogoo0?moo`ioo`0047oo0P00ogoo3goo000@Ool0 0`00Oomoo`3oOol>Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0@Goo0P00bWoo000@ Ool00`00Oomoo`11Ool2003:Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo 000@Ool2003oOol?Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0BWoo0P00`Goo000@ Ool00`00Oomoo`1:Ool20031Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo 000@Ool2001COol2002iOol0011oo`03001oogoo059oo`800;Uoo`0047oo00<007ooOol0ogoo3Woo 000@Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo 000@Ool00`00Oomoo`1KOol2002`Ool0011oo`8005aoo`800;1oo`0047oo00<007ooOol0ogoo3Woo 000@Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo0?moo`ioo`0027oo100017oo00<007ooOol0 ogoo3Woo0009Ool00`00Oomoo`04Ool00`00Oomoo`1SOol2002XOol000Yoo`03001oogoo00=oo`<0 06=oo`800:Qoo`002goo00<007ooOol00Woo00<007ooOol0ogoo3Woo0008Ool01000Oomoo`0017oo 00<007ooOol0ogoo3Woo0009Ool20005Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo06aoo`80 09moo`0047oo00<007ooOol0K7oo0P00Wgoo000@Ool2003oOol?Ool0011oo`03001oogoo0?moo`io o`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`1dOol2002GOol0011oo`03001oogoo07Ao o`8009Moo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`8007ioo`80 08ioo`0047oo00<007ooOol0OGoo0P00SWoo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo 0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`800?moo`mo o`0047oo00<007ooOol0QGoo0P00QWoo000@Ool00`00Oomoo`25Ool20026Ool0011oo`03001oogoo 0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo 08ioo`8007eoo`0047oo0P00Sgoo0P00OGoo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo 0?moo`ioo`0047oo00<007ooOol0ogoo3Woo0008Ool30005Ool00`00Oomoo`2GOol2001dOol000]o o`03001oogoo009oo`03001oogoo09Moo`8007Aoo`002goo00<007ooOol00Woo0`00ogoo3Woo0009 Ool20005Ool00`00Oomoo`3oOol>Ool000]oo`03001oogoo009oo`03001oogoo0?moo`ioo`0027oo 0`001Goo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001oogoo0?moo`io o`0047oo0P00X7oo0P00K7oo000@Ool00`00Oomoo`2OOol20007Ool2001SOol0011oo`03001oogoo 0:Qoo`8006=oo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool2002aOol2001KOol0011oo`03001oogoo 0;1oo`8005]oo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool2003oOol?Ool0011oo`03001oogoo0;Uo o`80059oo`0047oo00<007ooOol0^Goo0P00DWoo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`0047oo00<007ooOol0`Goo0P00BWoo000@Ool00`00Oomoo`31Ool2001:Ool0011o o`800?moo`moo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`002Goo0`0017oo00<007ooOol0bWoo0P00@Goo000:Ool00`00Oomoo`03Ool00`00 Oomoo`3:Ool20011Ool000Qoo`@000Aoo`<00?moo`ioo`0027oo00<007oo00001Goo00<007ooOol0 ogoo3Woo0008Ool00`00Ool00005Ool00`00Oomoo`3oOol>Ool000Uoo`8000Eoo`03001oogoo0=9o o`8003Uoo`0047oo00<007ooOol0dWoo0P00>Goo000@Ool00`00Oomoo`3oOol>Ool0011oo`800?mo o`moo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3KOol2000`Ool0011oo`03001oogoo 0=]oo`80031oo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`0047oo0P00ogoo3goo000@Ool00`00Oomoo`3SOol2000XOol0011oo`03001oogoo 0>=oo`8002Qoo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`0047oo0P00kGoo0P007goo000@Ool00`00Oomoo`3/Ool2000OOol0011oo`03001o ogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool0011oo`03001o ogoo0?moo`ioo`0047oo00<007ooOol0ogoo3Woo000@Ool2003fOol2000FOol0011oo`03001oogoo 0?Eoo`8001Ioo`0047oo00<007ooOol0ogoo3Woo000@Ool00`00Oomoo`3oOol>Ool000Qoo`<000Eo o`03001oogoo0?eoo`8000ioo`002goo00<007ooOol00Woo00<007ooOol0oGoo0P003Woo000;Ool0 0`00Oomoo`02Ool3003oOol>Ool000Qoo`<000Eoo`03001oogoo0?moo`ioo`0027oo00<007ooOol0 1Goo00<007ooOol0ogoo3Woo0008Ool4003oOolEOol00?moob5oo`00\ \>"], ImageRangeCache->{{{0, 287}, {176.938, 0}} -> {-1.96216, -0.386227, 0.116999, 0.0312357}}], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ ARCH: generate artificial time series with autoregressive \ conditional heteroskedasticity\ \>", "Section"], Cell[TextData[{ "These functions are based on the time series generation procedures written \ by Pedro J F de Lima of the Johns Hopkins University in the GAUSS programming \ language, available at ", StyleBox["ftp://speedy.econ.jhu.edu/public/gauss/st_proc.prc", FontFamily->"Courier", FontColor->RGBColor[0, 0, 1]], ". Note that the function tests to ensure that the coefficients are \ standardised, ie that \[Omega] =1 \[Dash] \[Sum]\[Alpha] \[Dash] \ \[Sum]\[Beta]. If this is not true the function definition will not match \ and nothing will happen." }], "Text"], Cell["With both AR and MA components, we have GARCH:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ARCHList[n_Integer, \[Omega]_Real, \[Alpha] : {__Real}, \[Beta] : {__Real}] /; \ \((\[Omega] == 1 - \((Plus@@\[Alpha])\) - \((Plus@@\[Beta])\))\) := \n \tWith[{m = Max[Length[\[Alpha]], Length[\[Beta]]]}, \n\t With[{q = Length[\[Alpha]], p = Length[\[Beta]], arev = Reverse[\[Alpha]], brev = Reverse[\[Beta]], z = RandomArray[NormalDistribution[0, 1], m + n]}, \n\t\t\t Module[{h = Table[1, {n + m}], e = Join[z\[LeftDoubleBracket]Range[m]\[RightDoubleBracket], Table[0, {n}]]}, \n\t\t\t\t Do[h\[LeftDoubleBracket]i\[RightDoubleBracket] = \[Omega]\ + \((\((e\[LeftDoubleBracket]Range[i - q, i - 1] \[RightDoubleBracket]\ )\)^2)\).arev + h\[LeftDoubleBracket]Range[i - p, i - 1] \[RightDoubleBracket]\ .brev; \n\t\t\t\t \(e\[LeftDoubleBracket]i\[RightDoubleBracket] = z\[LeftDoubleBracket]i\[RightDoubleBracket] + Sqrt[h\[LeftDoubleBracket]i\[RightDoubleBracket]]; \), {i, m + 1, n + m}]; \n\t\t\t\t{Drop[h, m], Drop[e, m]\ }]]] \)], "Input"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(brev\)\" is similar to \ existing symbol \"\!\(arev\)\"."\)], "Message"] }, Open ]], Cell["Without either AR or MA components we have white noise.", "Text"], Cell[BoxData[ \(ARCHList[n_Integer, \[Omega]_Real, {}, {}] := ARCHList[n, \[Omega]]\)], "Input"], Cell[BoxData[ \(ARCHList[n_Integer, \[Omega]_Real] := { RandomArray[NormalDistribution[0, 1], n], Table[1, {n}]}\)], "Input"], Cell["With only AR components, it's ARCH but not GARCH.", "Text"], Cell[BoxData[ \(ARCHList[n_Integer, \[Omega]_Real, \[Alpha] : {__Real}, {}] := ARCHList[n, \[Omega], \[Alpha]]\)], "Input"], Cell[BoxData[ \(ARCHList[n_Integer, \[Omega]_Real, \[Alpha] : {__Real}] /; \((\[Omega] == 1 - \((Plus@@\[Alpha])\))\) := \n\t\t With[{q = Length[\[Alpha]], arev = Reverse[\[Alpha]], z = RandomArray[NormalDistribution[0, 1], q + n]}, \n\t\t\t Module[{h = Table[1, {n + q}], e = z}, \n\t\t\t\t Do[h\[LeftDoubleBracket]i\[RightDoubleBracket] = \[Omega]\ + \((\((e\[LeftDoubleBracket]Range[i - q, i - 1] \[RightDoubleBracket]\ )\)^2)\).arev; \n\t\t\t\t \(e\[LeftDoubleBracket]i\[RightDoubleBracket] = z\[LeftDoubleBracket]i\[RightDoubleBracket] + Sqrt[h\[LeftDoubleBracket]i\[RightDoubleBracket]]; \), {i, q + 1, n + q}]; \n\t\t\t\t{Drop[h, q], Drop[e, q]\ }]]\)], "Input"], Cell["The following cells generates plot of some GARCH data.", "Text"], Cell[BoxData[ \(ListPlot[ \(ARCHList[1000, 0.05, {0.3, 0.2, 0.15}, {0.2, 0.1}] \)\[LeftDoubleBracket]1\[RightDoubleBracket], PlotJoined -> True, Frame -> True, PlotRange -> All, PlotStyle -> {AbsoluteThickness[2], GrayLevel[0.5]}]\)], "Input"], Cell[BoxData[ \(ListPlot[ \(ARCHList[1000, 0.05, {0.9, 0., 0.04}, {0.0, 0.01}] \)\[LeftDoubleBracket]1\[RightDoubleBracket], PlotJoined -> True, Frame -> True, PlotRange -> All, PlotStyle -> {AbsoluteThickness[2], GrayLevel[0.5]}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["EGARCH: artificial time series", "Section"], Cell[TextData[{ "These functions are based on the time series generation procedures written \ by Pedro J F de Lima of the Johns Hopkins University in the GAUSS programming \ language, available at ", StyleBox["ftp://speedy.econ.jhu.edu/public/gauss/st_proc.prc", FontFamily->"Courier", FontColor->RGBColor[0, 0, 1]], ". Note that I have used some of the functions in the standard ", StyleBox["Mathematica", FontSlant->"Italic"], " package \"LinearAlgebra`MatrixManipulation`\"." }], "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \($Packages\)], "Input"], Cell[BoxData[ \({"LinearAlgebra`MatrixManipulation`", "Statistics`Common`DistributionsCommon`", "Statistics`DescriptiveStatistics`", "Statistics`NormalDistribution`", "Statistics`ContinuousDistributions`", "Global`", "System`"}\)], "Output"] }, Open ]], Cell[BoxData[ \(EGARCHList[z : {__Real}, uncmean_, arpar_?VectorQ, mapar_?VectorQ, {\[Theta]1_, \[Theta]2_}] := \n\t With[{p = Length[arpar], q = Length[mapar] + 1, const = uncmean + \((1 - Plus@@arpar)\), n = Length[z]}, \ \n\t\t Module[{zlag, gz, \[Sigma]2}, \n\t\t\t zlag = \(Take[RotateLeft[z, #], n]&\)\ /@\ Range[0, q - 1]; \n\t\t\t gz = AppendRows[ZeroMatrix[q], \[Theta]1*zlag + \[Theta]2\ *\ \((Abs[zlag] - Sqrt[2./Pi])\)]; \n\t\t\t\[Sigma]2 = ARMAList[const + Reverse[Join[{1}, mapar]].gz, uncmean, arpar, {0}]; \n \t\t\t{z*Sqrt[Exp[Drop[\[Sigma]2, q - 1]\ ]], Drop[\[Sigma]2, q - 1]}\ ]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Fractional Noise: three methods.", "Section"], Cell[TextData[{ "These functions are based on the time series generation procedures written \ by Pedro J F de Lima of the Johns Hopkins University in the GAUSS programming \ language, available at ", StyleBox["ftp://speedy.econ.jhu.edu/public/gauss/gen_fnoi.prc", FontFamily->"Courier", FontColor->RGBColor[0, 0, 1]], ". There are three methods, finite Fourier transforms of Davies and Harte \ (1987), Hosking's recursive method (1984) and a method based on the Cholesky \ Decomposition. ( Note that this requires the standard Cholesky package to be \ read in first.) The choice between the three methods is handled as an option \ to the main function, then three subsidiary functions are used. These \ implementations are preliminary, as I cannot give any guarantees that I have \ understood the GAUSS code properly. In particular, the Hoskings method gives \ results that look rather different to the other two.\n" }], "Text"], Cell["This reads in the package.", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[TextData[{ "To do the Cholesky decomposition method, you also need this subsidiary \ function. \nToeplitz matrices are n \[Times] n symmetric matrices with \ elements ", Cell[BoxData[ \(TraditionalForm\`a\_\(i, j\) = a\_\(i - 1, j - 1\)\)]], " for i,j = 2\[Ellipsis]n." }], "Text"], Cell[BoxData[ \(createToeplitzMatrix[vec_?VectorQ] := \ With[{n = Length[vec]}, Array[vec\[LeftDoubleBracket]Abs[#1 - #2] + 1\[RightDoubleBracket]&, { n, n}]]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(createToeplitzMatrix[{\[Alpha], \[Beta], \[Gamma], \[Delta], \[Epsilon]}] // MatrixForm\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", GridBox[{ {"\[Alpha]", "\[Beta]", "\[Gamma]", "\[Delta]", "\[Epsilon]"}, {"\[Beta]", "\[Alpha]", "\[Beta]", "\[Gamma]", "\[Delta]"}, {"\[Gamma]", "\[Beta]", "\[Alpha]", "\[Beta]", "\[Gamma]"}, {"\[Delta]", "\[Gamma]", "\[Beta]", "\[Alpha]", "\[Beta]"}, {"\[Epsilon]", "\[Delta]", "\[Gamma]", "\[Beta]", "\[Alpha]"} }], ")"}], (MatrixForm[ #]&)]], "Output"] }, Open ]], Cell["It isn't the fastest, but it works.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[ Timing[createToeplitzMatrix[Table[Random[], {i}]]; ], {i, 50, 300, 50}] \)], "Input"], Cell[BoxData[ \({{0.149999999999998578`\ Second, Null}, {0.583333333333333925`\ Second, Null}, {1.28333333333333321`\ Second, Null}, { 2.33333333333333392`\ Second, Null}, {3.63333333333333285`\ Second, Null}, {5.216666666666665`\ Second, Null}}\)], "Output"] }, Open ]], Cell["This sets up the FFT method as the default.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Options[generateFractionalNoise] = {Method \[Rule] FiniteFourier}\)], "Input"], Cell[BoxData[ \({Method \[Rule] FiniteFourier}\)], "Output"] }, Open ]], Cell[BoxData[ \(generateFractionalNoise[n_Integer, d_Real, opts___?OptionQ] /; \((d > \(-0.5\)\ && \ d < 0.5)\) := \n\t Module[{way}, way = \(Method /. {opts}\) /. Options[generateFractionalNoise]; \n\t\t Switch[way, FiniteFourier, fourierFNoise[n, d], \ Hoskings, hoskingsFNoise[n, d], CholeskiDecomp, cholFNoise[n, d]]\ ]\)], "Input"], Cell[BoxData[ \(fourierFNoise[n_Integer, d_Real] /; \((d > \(-0.5\)\ && \ d < 0.5)\) := \n\t Module[{gk, u, v, z, x1, auto}, With[{\[ScriptN] = n + 1}, With[{rhopart = Thread[\((Range[\[ScriptN]] - 1 + d)\)/ \((Range[\[ScriptN]] - d)\)], auto0 = Gamma[1 - 2\ d]/\((Gamma[1 - d]^2)\)}, With[{\[Rho] = FoldList[Plus, First[rhopart], Rest[rhopart]]}, \n \t\t\t\tauto = auto0*\[Rho]; \n\t\t\t\t gk = Re[Fourier[ Join[{auto0}, Drop[auto, \(-1\)], Reverse[Drop[auto, \(-2\)]]]]\ ]; \n\t\t\t\t u = Thread[ Join[{\@2.}, Table[1, {\[ScriptN] - 2}], {\@2.}]* RandomArray[NormalDistribution[0, 1], \[ScriptN]]]; \n \t\t\t\tv = Join[{0.}, RandomArray[NormalDistribution[0, 1], \[ScriptN] - 2], { 0.}]; \n\t\t\t\t z = Join[Thread[u + \((I*v)\)], Reverse[ Thread[Drop[Rest[u], \(-1\)] + \((I*Drop[Rest[v], \(-1\)])\)]]]; \n\t\t\t\t x1 = 0.5*Re[Fourier[Thread[\@gk*z]]]/\@\(\[ScriptN] - 1\); \n \t\t\t\tTake[x1, \[ScriptN] - 1] - \((Plus@@Take[x1, \[ScriptN] - 1])\)/\((\[ScriptN] - 1)\)]]]] \)], "Input"], Cell[BoxData[ \(hoskingsFNoise[n_Integer, d_Real] /; \((d > \(-0.5\)\ && \ d < 0.5)\) := \n\t Module[{vlist, \[Phi]tt, \[Phi]lists}, \n\t With[{k = Range[n], v0 = Gamma[1 - 2\ d]/\((Gamma[1 - d]^2)\)}, \n \t\t\t\[Phi]tt = d/\((k - d)\); \n\t\t\t vlist = Drop[ FoldList[\((1 - \((#2)\)^2\ )\)*\ #1\ &\ , v0, \[Phi]tt], \(-1\)]; \n\t\t\t \[Phi]lists = FoldList[Flatten[Join[{#1} - #2*\ Reverse[{#1}], {#2}]]&\ , \ First[\[Phi]tt], Rest[\[Phi]tt]]; \n\t\t\ \ Rest[Flatten[ Last[\n\t\t\t\t\t\t FoldList[ Join[{#1}, Flatten[{ \@\((#2\[LeftDoubleBracket]1\[RightDoubleBracket]) \)\ *Random[NormalDistribution[0, 1]] + \((Flatten[{#2\[LeftDoubleBracket]2 \[RightDoubleBracket]}].Reverse[ Flatten[{#1}]])\)}]]\ &, \ \@v0*Random[NormalDistribution[0, 1]], Transpose[{vlist, \[Phi]lists}]]\ ]]]\ ]]\)], "Input"], Cell[BoxData[ \(\(cholFNoise[n_Integer, d_Real] /; \((d > 0.\ && \ d < 0.5)\) := \n\t With[{\[Tau] = Range[n], \[Sigma]e = 1}, \n\t With[{\tauto1 = Exp[LogGamma[1] + LogGamma[1 - 2\ d] - LogGamma[d] - LogGamma[1 - d] + LogGamma[d + \[Tau]] - LogGamma[1 - d + \[Tau]]]}, \n\t\t Transpose[ CholeskyDecomposition[createToeplitzMatrix[auto1]]].RandomArray[ NormalDistribution[0, 1], n]\ ]]\n\t\t\)\)], "Input"], Cell["\<\ The Fourier method seems to be fastest. The Timings below are from \ a Power Macintosh G3 233 MHz with 64 Mb of RAM and virtual memory on.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ListPlot[generateFractionalNoise[500, 0.49999], PlotJoined \[Rule] True] // Timing\)], "Input"], Cell["{0.333333 Second}", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ListPlot[generateFractionalNoise[100, 0.49, Method \[Rule] Hoskings], PlotJoined \[Rule] True] // Timing\)], "Input"], Cell["{0.233333 Second}", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ListPlot[ generateFractionalNoise[100, 0.49, Method \[Rule] CholeskiDecomp], PlotJoined \[Rule] True] // Timing\)], "Input"], Cell["{2.13333 Second}", "Text"] }, Open ]] }, Closed]] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 1152}, {0, 850}}, AutoGeneratedPackage->None, PrintingStyleEnvironment->"Working", WindowToolbars->{}, CellGrouping->Manual, WindowSize->{887, 800}, WindowMargins->{{98, Automatic}, {7, Automatic}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, MacintoshSystemPageSetup->"\<\ 00<0001804P000000`d26_oQon@3:`8g0dL5N`?P0080001804P000000]P2:001 0000I00000400`<30?l00BL?00400@0000000000000006P801T1T00000000000 00000000004000000000000000000000\>" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1709, 49, 54, 0, 98, "Title"], Cell[CellGroupData[{ Cell[1788, 53, 103, 2, 50, "Section"], Cell[1894, 57, 156, 4, 30, "Text"], Cell[2053, 63, 132, 3, 27, "Input"] }, Open ]], Cell[2200, 69, 128, 3, 30, "Text"], Cell[2331, 74, 79, 1, 27, "Input"], Cell[2413, 77, 168, 4, 30, "Text"], Cell[CellGroupData[{ Cell[2606, 85, 42, 1, 27, "Input"], Cell[2651, 88, 225, 4, 41, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2913, 97, 121, 2, 50, "Section"], Cell[3037, 101, 681, 18, 64, "Text"], Cell[3721, 121, 223, 5, 75, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3981, 131, 117, 2, 30, "Section"], Cell[4101, 135, 436, 9, 95, "Text"], Cell[4540, 146, 791, 16, 107, "Input"], Cell[5334, 164, 205, 4, 30, "Text"], Cell[5542, 170, 269, 4, 59, "Input"], Cell[5814, 176, 663, 14, 107, "Input"], Cell[6480, 192, 74, 0, 30, "Text"], Cell[6557, 194, 729, 15, 91, "Input"], Cell[7289, 211, 256, 5, 43, "Input"], Cell[7548, 218, 608, 14, 75, "Input"], Cell[8159, 234, 35, 0, 30, "Text"], Cell[CellGroupData[{ Cell[8219, 238, 286, 6, 91, "Input"], Cell[8508, 246, 39786, 1646, 186, 20398, 1402, "GraphicsData", "PostScript", "Graphics"], Cell[48297, 1894, 208, 5, 26, "Output"] }, Open ]], Cell[48520, 1902, 142, 3, 30, "Text"], Cell[CellGroupData[{ Cell[48687, 1909, 164, 4, 27, "Input"], Cell[48854, 1915, 1344, 20, 116, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[50235, 1940, 78, 1, 27, "Input"], Cell[50316, 1943, 10711, 364, 186, 3932, 276, "GraphicsData", "PostScript", "Graphics"], Cell[61030, 2309, 130, 3, 26, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[61209, 2318, 117, 3, 50, "Section"], Cell[61329, 2323, 583, 11, 63, "Text"], Cell[61915, 2336, 62, 0, 30, "Text"], Cell[CellGroupData[{ Cell[62002, 2340, 1260, 21, 139, "Input"], Cell[63265, 2363, 175, 3, 22, "Message"] }, Open ]], Cell[63455, 2369, 71, 0, 30, "Text"], Cell[63529, 2371, 103, 2, 27, "Input"], Cell[63635, 2375, 137, 2, 27, "Input"], Cell[63775, 2379, 65, 0, 30, "Text"], Cell[63843, 2381, 134, 2, 27, "Input"], Cell[63980, 2385, 838, 14, 107, "Input"], Cell[64821, 2401, 70, 0, 30, "Text"], Cell[64894, 2403, 277, 5, 43, "Input"], Cell[65174, 2410, 277, 5, 43, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[65488, 2420, 49, 0, 30, "Section"], Cell[65540, 2422, 514, 11, 63, "Text"], Cell[66057, 2435, 79, 1, 27, "Input"], Cell[CellGroupData[{ Cell[66161, 2440, 42, 1, 27, "Input"], Cell[66206, 2443, 269, 5, 41, "Output"] }, Open ]], Cell[66490, 2451, 746, 13, 123, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[67273, 2469, 51, 0, 30, "Section"], Cell[67327, 2471, 945, 15, 111, "Text"], Cell[68275, 2488, 42, 0, 30, "Text"], Cell[68320, 2490, 69, 1, 27, "Input"], Cell[68392, 2493, 300, 7, 46, "Text"], Cell[68695, 2502, 203, 4, 27, "Input"], Cell[CellGroupData[{ Cell[68923, 2510, 131, 2, 27, "Input"], Cell[69057, 2514, 479, 9, 100, "Output"] }, Open ]], Cell[69551, 2526, 51, 0, 30, "Text"], Cell[CellGroupData[{ Cell[69627, 2530, 124, 3, 27, "Input"], Cell[69754, 2535, 289, 4, 41, "Output"] }, Open ]], Cell[70058, 2542, 59, 0, 30, "Text"], Cell[CellGroupData[{ Cell[70142, 2546, 101, 2, 27, "Input"], Cell[70246, 2550, 64, 1, 26, "Output"] }, Open ]], Cell[70325, 2554, 387, 7, 75, "Input"], Cell[70715, 2563, 1419, 28, 213, "Input"], Cell[72137, 2593, 1197, 23, 213, "Input"], Cell[73337, 2618, 516, 9, 123, "Input"], Cell[73856, 2629, 166, 4, 30, "Text"], Cell[CellGroupData[{ Cell[74047, 2637, 124, 2, 27, "Input"], Cell[74174, 2641, 33, 0, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[74244, 2646, 146, 2, 27, "Input"], Cell[74393, 2650, 33, 0, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[74463, 2655, 161, 3, 27, "Input"], Cell[74627, 2660, 32, 0, 30, "Text"] }, Open ]] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)