\(\(
 (*\ 
      This\ file\ does\ the\ simulaiton\ of\ the\ ODE\ for\ the\ mean\ 
          dynamics\ in\ the\ Cho - 
        Sargent
	model\ of\ conquering\ Nash\ inflation . \ These\ 
          simulations\ hsow\ how, \ for\ certain\ starting\ points, \ 
	
      the\ mean\ dynamics\ have\ the\ escape\ route\ phenomenon . \ However, 
      \ from\ other\ starting\ points, \ 
      there\ 
	are\ no\ escape\ routes\ in\ the\ mean\ 
        dynamics . \ \ 
		
		
          \(Note : \ 
            here\ the\ starting\ points\ are\ approximately\ on\ the\ 50\ 
              percent\ concentration\ ellipsoid\ in\ the\ directions\ of\ the
              \ principal\ \(axes . \)\)\ *) \ \ \)\)

\(ustar = 5; 
phi = 1; 
sig1 = 0.3; 
sig2 = 0.3; \)

\(\(
M = {{1, \(-b0[t]\)*b1[t]/\((1 + b1[t]^2)\)}, {
          \(-b0[t]\)*b1[t]/\((1 + b1[t]^2)\), 
          \((\((b0[t]*b1[t])\)/\((1 + b1[t]^2)\))\)^2 + sig2^2}}; 

    R = {{R11[t], R12[t]}, {R12[t], R22[t]}}; 

    TI = {ustar - phi*b0[t]*b1[t]/\((1 + b1[t]^2)\) - b0[t], 
        \(-phi\) - b1[t]}; \)\)

\(\(
hbet = Inverse[R] . M . TI; 
hR = M - R; \)\)

\(\(
eqb0 = \(b0'\)[t] == hbet[\([1]\)]; 

    eqb1 = \(b1'\)[t] == hbet[\([2]\)]; 

    eqR11 = \(R11'\)[t] == hR[\([1, 1]\)]; 

    eqR12 = \(R12'\)[t] == hR[\([1, 2]\)]; 

    eqR22 = \(R22'\)[t] == hR[\([2, 2]\)]; 
\)\)

\(\(

\($DefaultFont = {"Helvetica-Bold", 12}; \)\)\)

\(\(
lsqsolHH = 
      NDSolve[{\(b0'\)[t] == hbet[\([1]\)], \(b1'\)[t] == hbet[\([2]\)], 

          			\(R11'\)[t] == hR[\([1, 1]\)], \(R12'\)[t] == hR[\([1, 2]\)], 
          \(R22'\)[t] == hR[\([2, 2]\)], b0[0] == 10.75, b1[0] == \(-1.1\), 
          R11[0] == 1, R12[0] == ustar*phi, 
          R22[0] == \((ustar*phi)\)^2 + sig2^2}, 

        		{b0[t], b1[t], R11[t], R12[t], R22[t]}, {t, 0, 100}]\)\)

\(\(plotHH11 = 
      Plot[Evaluate[{b0[t], b1[t]} /. lsqsolHH], {t, 0, 50}, 	
        PlotStyle -> {AbsoluteThickness[2]}, 
		
        PlotLabel -> 
          FontForm["Figure 14.6a", {"Helvetica-Bold", 16}], 
        Frame -> True, FrameLabel -> {"time", "beta0 and beta1"}]

    \)\)

\(\(
 (*
      	PlotStyle -> {AbsoluteThickness[2]}, 
		
        PlotLabel -> FontForm["Figure 15.6", {"Helvetica-Bold", 16}], 
        Frame -> True, FrameLabel -> {"time", "beta0 and beta1"}]
        \ \ \ *) \)\)

\(\(
lsqsolLL = 
      NDSolve[{\(b0'\)[t] == hbet[\([1]\)], \(b1'\)[t] == hbet[\([2]\)], 

          			\(R11'\)[t] == hR[\([1, 1]\)], \(R12'\)[t] == hR[\([1, 2]\)], 
          \(R22'\)[t] == hR[\([2, 2]\)], b0[0] == 9.25, b1[0] == \(-0.9\), 
          R11[0] == 1, R12[0] == ustar*phi, 
          R22[0] == \((ustar*phi)\)^2 + sig2^2}, 

        		{b0[t], b1[t], R11[t], R12[t], R22[t]}, {t, 0, 100}]\)\)

\(\(
plotLL11 = 
      Plot[Evaluate[{b0[t], b1[t]} /. lsqsolLL], {t, 0, 50}, 	
        PlotStyle -> {AbsoluteThickness[2]}, 
		
        PlotLabel -> 
          FontForm["Figure 14.6b", {"Helvetica-Bold", 16}], 
        Frame -> True, FrameLabel -> {"time", "beta0 and beta1"}]
        \)\)

\(
lsqsolHL = 
      NDSolve[{\(b0'\)[t] == hbet[\([1]\)], \(b1'\)[t] == hbet[\([2]\)], 

          			\(R11'\)[t] == hR[\([1, 1]\)], \(R12'\)[t] == hR[\([1, 2]\)], 
          \(R22'\)[t] == hR[\([2, 2]\)], b0[0] == 9.85, b1[0] == \(-1.025\), 
          R11[0] == 1, R12[0] == ustar*phi, 
          R22[0] == \((ustar*phi)\)^2 + sig2^2}, 

        		{b0[t], b1[t], R11[t], R12[t], R22[t]}, {t, 0, 100}]

\)\(plotHL11 = 
      Plot[Evaluate[{b0[t], b1[t]} /. lsqsolHL], {t, 0, 50}, 	
        PlotStyle -> {AbsoluteThickness[2]}, 
		
        PlotLabel -> 
          FontForm["Figure 14.6c", {"Helvetica-Bold", 16}], 
        Frame -> True, FrameLabel -> {"time", "beta0 and beta1"}]
        \)

\(

lsqsolLH = 
      NDSolve[{\(b0'\)[t] == hbet[\([1]\)], \(b1'\)[t] == hbet[\([2]\)], 

          			\(R11'\)[t] == hR[\([1, 1]\)], \(R12'\)[t] == hR[\([1, 2]\)], 
          \(R22'\)[t] == hR[\([2, 2]\)], b0[0] == 10.15, b1[0] == \(-0.975\), 
          R11[0] == 1, R12[0] == ustar*phi, 
          R22[0] == \((ustar*phi)\)^2 + sig2^2}, 

        		{b0[t], b1[t], R11[t], R12[t], R22[t]}, {t, 0, 100}]

\)\(plotLH11 = 
      Plot[Evaluate[{b0[t], b1[t]} /. lsqsolLH], {t, 0, 50}, 	
        PlotStyle -> {AbsoluteThickness[2]}, 
		
        PlotLabel -> 
          FontForm["Figure 14.6d", {"Helvetica-Bold", 16}], 
        Frame -> True, FrameLabel -> {"time", "beta0 and beta1"}]
        \)

\(\(


    Show[GraphicsArray[{{plotHH11, plotLL11}, {plotHL11, plotLH11}}]]\)\)