diff --git a/doc/dynare.plots/BaxterKingFilter.eps b/doc/dynare.plots/BaxterKingFilter.eps
new file mode 100644
index 0000000000000000000000000000000000000000..60765a8a5979d972deb53b05880b5d46b1b5530a
--- /dev/null
+++ b/doc/dynare.plots/BaxterKingFilter.eps
@@ -0,0 +1,384 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: MATLAB, The MathWorks, Inc. Version 8.1.0.604 (R2013a). Operating System: Linux 3.10-3-amd64 #1 SMP Debian 3.10.11-1 (2013-09-10) x86_64.
+%%Title: ../doc/dynare.plots/BaxterKingFilter.eps
+%%CreationDate: 11/12/2013  18:18:18
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%LanguageLevel: 2
+%%Pages: 1
+%%BoundingBox:    70   213   546   591
+%%EndComments
+
+%%BeginProlog
+% MathWorks dictionary
+/MathWorks 160 dict begin
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+% operator abbreviations
+/c  /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s {show newpath} bdef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/sg /setgray ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+% orientation switch
+/portraitMode 0 def /landscapeMode 1 def /rotateMode 2 def
+% coordinate system mappings
+/dpi2point 0 def
+% font control
+/FontSize 0 def
+/FMS {/FontSize xstore findfont [FontSize 0 0 FontSize neg 0 0]
+  makefont setfont} bdef
+/reencode {exch dup where {pop load} {pop StandardEncoding} ifelse
+  exch dup 3 1 roll findfont dup length dict begin
+  { 1 index /FID ne {def}{pop pop} ifelse } forall
+  /Encoding exch def currentdict end definefont pop} bdef
+/isroman {findfont /CharStrings get /Agrave known} bdef
+/FMSR {3 1 roll 1 index dup isroman {reencode} {pop pop} ifelse
+  exch FMS} bdef
+/csm {1 dpi2point div -1 dpi2point div scale neg translate
+ dup landscapeMode eq {pop -90 rotate}
+  {rotateMode eq {90 rotate} if} ifelse} bdef
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
+  dpi2point mul] 0 setdash } bdef
+% macros for lines and objects
+/L {lineto stroke} bdef
+/MP {3 1 roll moveto 1 sub {rlineto} repeat} bdef
+/AP {{rlineto} repeat} bdef
+/PDlw -1 def
+/W {/PDlw currentlinewidth def setlinewidth} def
+/PP {closepath eofill} bdef
+/DP {closepath stroke} bdef
+/MR {4 -2 roll moveto dup  0 exch rlineto exch 0 rlineto
+  neg 0 exch rlineto closepath} bdef
+/FR {MR stroke} bdef
+/PR {MR fill} bdef
+/L1i {{currentfile picstr readhexstring pop} image} bdef
+/tMatrix matrix def
+/MakeOval {newpath tMatrix currentmatrix pop translate scale
+0 0 1 0 360 arc tMatrix setmatrix} bdef
+/FO {MakeOval stroke} bdef
+/PO {MakeOval fill} bdef
+/PD {currentlinewidth 2 div 0 360 arc fill
+   PDlw -1 eq not {PDlw w /PDlw -1 def} if} def
+/FA {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arc tMatrix setmatrix stroke} bdef
+/PA {newpath tMatrix currentmatrix pop	translate 0 0 moveto scale
+  0 0 1 5 -2 roll arc closepath tMatrix setmatrix fill} bdef
+/FAn {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arcn tMatrix setmatrix stroke} bdef
+/PAn {newpath tMatrix currentmatrix pop translate 0 0 moveto scale
+  0 0 1 5 -2 roll arcn closepath tMatrix setmatrix fill} bdef
+/vradius 0 def /hradius 0 def /lry 0 def
+/lrx 0 def /uly 0 def /ulx 0 def /rad 0 def
+/MRR {/vradius xdef /hradius xdef /lry xdef /lrx xdef /uly xdef
+  /ulx xdef newpath tMatrix currentmatrix pop ulx hradius add uly
+  vradius add translate hradius vradius scale 0 0 1 180 270 arc 
+  tMatrix setmatrix lrx hradius sub uly vradius add translate
+  hradius vradius scale 0 0 1 270 360 arc tMatrix setmatrix
+  lrx hradius sub lry vradius sub translate hradius vradius scale
+  0 0 1 0 90 arc tMatrix setmatrix ulx hradius add lry vradius sub
+  translate hradius vradius scale 0 0 1 90 180 arc tMatrix setmatrix
+  closepath} bdef
+/FRR {MRR stroke } bdef
+/PRR {MRR fill } bdef
+/MlrRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lry uly sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 90 270 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 270 90 arc tMatrix setmatrix
+  closepath} bdef
+/FlrRR {MlrRR stroke } bdef
+/PlrRR {MlrRR fill } bdef
+/MtbRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lrx ulx sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 180 360 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 0 180 arc tMatrix setmatrix
+  closepath} bdef
+/FtbRR {MtbRR stroke } bdef
+/PtbRR {MtbRR fill } bdef
+/stri 6 array def /dtri 6 array def
+/smat 6 array def /dmat 6 array def
+/tmat1 6 array def /tmat2 6 array def /dif 3 array def
+/asub {/ind2 exch def /ind1 exch def dup dup
+  ind1 get exch ind2 get sub exch } bdef
+/tri_to_matrix {
+  2 0 asub 3 1 asub 4 0 asub 5 1 asub
+  dup 0 get exch 1 get 7 -1 roll astore } bdef
+/compute_transform {
+  dmat dtri tri_to_matrix tmat1 invertmatrix 
+  smat stri tri_to_matrix tmat2 concatmatrix } bdef
+/ds {stri astore pop} bdef
+/dt {dtri astore pop} bdef
+/db {2 copy /cols xdef /rows xdef mul dup 3 mul string
+  currentfile 
+  3 index 0 eq {/ASCIIHexDecode filter}
+  {/ASCII85Decode filter 3 index 2 eq {/RunLengthDecode filter} if }
+  ifelse exch readstring pop
+  dup 0 3 index getinterval /rbmap xdef
+  dup 2 index dup getinterval /gbmap xdef
+  1 index dup 2 mul exch getinterval /bbmap xdef pop pop}bdef
+/it {gs np dtri aload pop moveto lineto lineto cp c
+  cols rows 8 compute_transform 
+  rbmap gbmap bbmap true 3 colorimage gr}bdef
+/il {newpath moveto lineto stroke}bdef
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox:    70   213   546   591
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: obj1
+bplot
+
+/dpi2point 12 def
+portraitMode 0216 7344 csm
+
+  628   247  5717  4541 rc
+85 dict begin %Colortable dictionary
+/c0 { 0.000000 0.000000 0.000000 sr} bdef
+/c1 { 1.000000 1.000000 1.000000 sr} bdef
+/c2 { 0.900000 0.000000 0.000000 sr} bdef
+/c3 { 0.000000 0.820000 0.000000 sr} bdef
+/c4 { 0.000000 0.000000 0.800000 sr} bdef
+/c5 { 0.910000 0.820000 0.320000 sr} bdef
+/c6 { 1.000000 0.260000 0.820000 sr} bdef
+/c7 { 0.000000 0.820000 0.820000 sr} bdef
+c0
+1 j
+1 sg
+   0    0 6913 5186 rf
+6 w
+0 4226 5356 0 0 -4226 899 4615 4 MP
+PP
+-5356 0 0 4226 5356 0 0 -4226 899 4615 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+ 899 4615 mt 6255 4615 L
+ 899  389 mt 6255  389 L
+ 899 4615 mt  899  389 L
+6255 4615 mt 6255  389 L
+ 899 4615 mt 6255 4615 L
+ 899 4615 mt  899  389 L
+1480 4615 mt 1480 4561 L
+1480  389 mt 1480  442 L
+%%IncludeResource: font Helvetica
+/Helvetica /ISOLatin1Encoding 120 FMSR
+
+1267 4760 mt 
+(1957Q4) s
+2092 4615 mt 2092 4561 L
+2092  389 mt 2092  442 L
+1879 4760 mt 
+(1962Q4) s
+2704 4615 mt 2704 4561 L
+2704  389 mt 2704  442 L
+2491 4760 mt 
+(1967Q4) s
+3316 4615 mt 3316 4561 L
+3316  389 mt 3316  442 L
+3103 4760 mt 
+(1972Q4) s
+3928 4615 mt 3928 4561 L
+3928  389 mt 3928  442 L
+3715 4760 mt 
+(1977Q4) s
+4541 4615 mt 4541 4561 L
+4541  389 mt 4541  442 L
+4328 4760 mt 
+(1982Q4) s
+5153 4615 mt 5153 4561 L
+5153  389 mt 5153  442 L
+4940 4760 mt 
+(1987Q4) s
+5765 4615 mt 5765 4561 L
+5765  389 mt 5765  442 L
+5552 4760 mt 
+(1992Q4) s
+ 899 4514 mt  952 4514 L
+6255 4514 mt 6201 4514 L
+ 728 4558 mt 
+(-1) s
+ 899 4050 mt  952 4050 L
+6255 4050 mt 6201 4050 L
+ 628 4094 mt 
+(-0.8) s
+ 899 3585 mt  952 3585 L
+6255 3585 mt 6201 3585 L
+ 628 3629 mt 
+(-0.6) s
+ 899 3121 mt  952 3121 L
+6255 3121 mt 6201 3121 L
+ 628 3165 mt 
+(-0.4) s
+ 899 2657 mt  952 2657 L
+6255 2657 mt 6201 2657 L
+ 628 2701 mt 
+(-0.2) s
+ 899 2193 mt  952 2193 L
+6255 2193 mt 6201 2193 L
+ 798 2237 mt 
+(0) s
+ 899 1729 mt  952 1729 L
+6255 1729 mt 6201 1729 L
+ 698 1773 mt 
+(0.2) s
+ 899 1264 mt  952 1264 L
+6255 1264 mt 6201 1264 L
+ 698 1308 mt 
+(0.4) s
+ 899  800 mt  952  800 L
+6255  800 mt 6201  800 L
+ 698  844 mt 
+(0.6) s
+ 899 4615 mt 6255 4615 L
+ 899  389 mt 6255  389 L
+ 899 4615 mt  899  389 L
+6255 4615 mt 6255  389 L
+gs 899 389 5357 4227 rc
+31 12 31 676 30 -486 31 425 31 -1153 30 -555 31 -24 30 460 
+31 -265 31 -694 30 753 31 -407 30 230 31 -138 31 659 30 472 
+31 -400 30 -229 31 -107 31 -5 30 -479 31 615 30 -148 31 597 
+31 -50 30 -1070 31 679 30 77 31 493 31 524 30 -41 31 -1027 
+30 -141 31 214 31 3 30 -157 31 198 31 202 30 -681 31 411 
+30 -34 31 -120 31 4 30 -526 31 -11 30 275 31 1054 31 176 
+30 -1612 31 249 30 1174 31 -48 31 -535 30 609 31 364 30 -70 
+31 -1162 31 454 30 579 31 -638 30 210 31 -685 31 1139 30 -375 
+31 405 30 1063 31 -819 31 -1243 30 -191 31 54 31 182 30 -625 
+31 742 30 307 31 -138 31 18 30 -392 31 1208 30 -331 31 -617 
+31 -397 30 500 31 -129 30 650 31 -643 31 -39 30 -633 31 262 
+30 238 31 -119 31 581 30 -78 31 418 30 277 31 -272 31 -539 
+30 619 31 418 30 -911 31 -454 31 -270 30 -569 31 1089 30 -246 
+31 210 31 532 30 303 31 -230 31 -1012 30 156 31 -977 30 -216 
+31 452 31 -425 30 1663 31 -578 30 1117 31 122 31 -122 30 -108 
+31 399 30 22 31 -661 31 60 30 125 31 1128 30 -715 31 -50 
+31 -594 30 -469 31 153 30 287 31 -45 31 462 30 273 31 -89 
+30 -321 31 -421 31 -124 30 297 31 -159 31 -443 30 286 31 -229 
+30 -7 31 213 31 97 30 598 31 -556 30 -367 31 -95 31 391 
+30 -463 31 268 30 1060 31 -948 31 419 30 -89 31 566 30 -43 
+31 -678 31 -47 30 573 31 -23 30 604 31 -26 31 -643 30 409 
+31 293 30 -83 31 -665 31 510 30 -870 31 78 30 589 899 1359 176 MP stroke
+DA
+/c8 { 1.000000 0.000000 0.000000 sr} bdef
+c8
+31 299 31 88 30 -301 31 -716 31 -901 30 -729 31 -326 30 58 
+31 216 31 118 30 -42 31 10 30 279 31 615 31 724 30 429 
+31 -134 30 -602 31 -680 31 -328 30 199 31 505 30 392 31 -47 
+31 -388 30 -329 31 128 30 619 31 705 31 319 30 -296 31 -731 
+30 -703 31 -295 31 110 30 239 31 148 31 58 30 9 31 -102 
+30 -214 31 -260 31 -210 30 -6 31 321 30 534 31 380 31 -5 
+30 -274 31 -224 30 104 31 428 31 485 30 180 31 -257 30 -450 
+31 -305 31 -81 30 -35 31 -167 30 -196 31 70 31 490 30 719 
+31 565 30 27 31 -720 31 -1174 30 -1007 31 -337 31 317 30 581 
+31 483 30 286 31 215 31 247 30 237 31 72 30 -222 31 -387 
+31 -252 30 10 31 165 30 102 31 -128 31 -430 30 -519 31 -200 
+30 336 31 751 31 738 30 361 31 5 30 -129 31 -78 31 21 
+30 -17 31 -229 30 -555 31 -725 31 -612 30 -187 31 402 30 816 
+31 912 31 573 30 -19 31 -590 31 -942 30 -1036 31 -803 30 -229 
+31 441 31 900 30 1018 31 860 30 591 31 341 31 75 30 -227 
+31 -457 30 -466 31 -276 31 47 30 293 31 237 30 -104 31 -601 
+31 -861 30 -663 31 -72 30 568 31 886 31 685 30 148 31 -345 
+30 -547 31 -399 31 -134 30 44 31 18 31 -103 30 -176 31 -84 
+30 202 31 451 31 429 30 93 31 -293 30 -440 31 -292 31 4 
+30 245 31 322 30 302 31 230 31 111 30 -34 31 -158 30 -209 
+31 -178 31 15 30 223 31 310 30 298 31 226 31 58 30 -143 
+31 -200 30 -175 31 -115 31 -137 30 -250 31 -397 30 -514 899 2994 176 MP stroke
+gr
+
+c8
+DA
+0 sg
+ 882 4658 mt 
+( ) s
+6239  431 mt 
+( ) s
+SO
+1 sg
+0 334 1903 0 0 -334 4293 783 4 MP
+PP
+-1903 0 0 334 1903 0 0 -334 4293 783 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+4293  783 mt 6196  783 L
+4293  449 mt 6196  449 L
+4293  783 mt 4293  449 L
+6196  783 mt 6196  449 L
+4293  783 mt 6196  783 L
+4293  783 mt 4293  449 L
+4293  783 mt 6196  783 L
+4293  449 mt 6196  449 L
+4293  783 mt 4293  449 L
+6196  783 mt 6196  449 L
+4756  583 mt 
+(Stationary component of y) s
+gs 4293 449 1904 335 rc
+356 0 4364 540 2 MP stroke
+gr
+
+4756  734 mt 
+(Filtered y) s
+gs 4293 449 1904 335 rc
+DA
+c8
+356 0 4364 691 2 MP stroke
+SO
+gr
+
+c8
+
+end %%Color Dict
+
+eplot
+%%EndObject
+
+epage
+end
+
+showpage
+
+%%Trailer
+%%EOF
diff --git a/doc/dynare.plots/BaxterKingFilter.jpg b/doc/dynare.plots/BaxterKingFilter.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..579cb8c1e677b644d9dfb30fb1048e6fbee995ef
Binary files /dev/null and b/doc/dynare.plots/BaxterKingFilter.jpg differ
diff --git a/doc/dynare.plots/BaxterKingFilter.png b/doc/dynare.plots/BaxterKingFilter.png
new file mode 100644
index 0000000000000000000000000000000000000000..13f972d978a65ef2ae5ba216977f4edaf27ba582
Binary files /dev/null and b/doc/dynare.plots/BaxterKingFilter.png differ
diff --git a/doc/dynare.plots/HPCycle.eps b/doc/dynare.plots/HPCycle.eps
new file mode 100644
index 0000000000000000000000000000000000000000..09788100d0f339454d5d3cf8bab7c5dbab87f17b
--- /dev/null
+++ b/doc/dynare.plots/HPCycle.eps
@@ -0,0 +1,386 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: MATLAB, The MathWorks, Inc. Version 8.1.0.604 (R2013a). Operating System: Linux 3.10-3-amd64 #1 SMP Debian 3.10.11-1 (2013-09-10) x86_64.
+%%Title: ../doc/dynare.plots/HPCycle.eps
+%%CreationDate: 11/12/2013  18:12:56
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%LanguageLevel: 2
+%%Pages: 1
+%%BoundingBox:    70   213   561   591
+%%EndComments
+
+%%BeginProlog
+% MathWorks dictionary
+/MathWorks 160 dict begin
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+% operator abbreviations
+/c  /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s {show newpath} bdef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/sg /setgray ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+% orientation switch
+/portraitMode 0 def /landscapeMode 1 def /rotateMode 2 def
+% coordinate system mappings
+/dpi2point 0 def
+% font control
+/FontSize 0 def
+/FMS {/FontSize xstore findfont [FontSize 0 0 FontSize neg 0 0]
+  makefont setfont} bdef
+/reencode {exch dup where {pop load} {pop StandardEncoding} ifelse
+  exch dup 3 1 roll findfont dup length dict begin
+  { 1 index /FID ne {def}{pop pop} ifelse } forall
+  /Encoding exch def currentdict end definefont pop} bdef
+/isroman {findfont /CharStrings get /Agrave known} bdef
+/FMSR {3 1 roll 1 index dup isroman {reencode} {pop pop} ifelse
+  exch FMS} bdef
+/csm {1 dpi2point div -1 dpi2point div scale neg translate
+ dup landscapeMode eq {pop -90 rotate}
+  {rotateMode eq {90 rotate} if} ifelse} bdef
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
+  dpi2point mul] 0 setdash } bdef
+% macros for lines and objects
+/L {lineto stroke} bdef
+/MP {3 1 roll moveto 1 sub {rlineto} repeat} bdef
+/AP {{rlineto} repeat} bdef
+/PDlw -1 def
+/W {/PDlw currentlinewidth def setlinewidth} def
+/PP {closepath eofill} bdef
+/DP {closepath stroke} bdef
+/MR {4 -2 roll moveto dup  0 exch rlineto exch 0 rlineto
+  neg 0 exch rlineto closepath} bdef
+/FR {MR stroke} bdef
+/PR {MR fill} bdef
+/L1i {{currentfile picstr readhexstring pop} image} bdef
+/tMatrix matrix def
+/MakeOval {newpath tMatrix currentmatrix pop translate scale
+0 0 1 0 360 arc tMatrix setmatrix} bdef
+/FO {MakeOval stroke} bdef
+/PO {MakeOval fill} bdef
+/PD {currentlinewidth 2 div 0 360 arc fill
+   PDlw -1 eq not {PDlw w /PDlw -1 def} if} def
+/FA {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arc tMatrix setmatrix stroke} bdef
+/PA {newpath tMatrix currentmatrix pop	translate 0 0 moveto scale
+  0 0 1 5 -2 roll arc closepath tMatrix setmatrix fill} bdef
+/FAn {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arcn tMatrix setmatrix stroke} bdef
+/PAn {newpath tMatrix currentmatrix pop translate 0 0 moveto scale
+  0 0 1 5 -2 roll arcn closepath tMatrix setmatrix fill} bdef
+/vradius 0 def /hradius 0 def /lry 0 def
+/lrx 0 def /uly 0 def /ulx 0 def /rad 0 def
+/MRR {/vradius xdef /hradius xdef /lry xdef /lrx xdef /uly xdef
+  /ulx xdef newpath tMatrix currentmatrix pop ulx hradius add uly
+  vradius add translate hradius vradius scale 0 0 1 180 270 arc 
+  tMatrix setmatrix lrx hradius sub uly vradius add translate
+  hradius vradius scale 0 0 1 270 360 arc tMatrix setmatrix
+  lrx hradius sub lry vradius sub translate hradius vradius scale
+  0 0 1 0 90 arc tMatrix setmatrix ulx hradius add lry vradius sub
+  translate hradius vradius scale 0 0 1 90 180 arc tMatrix setmatrix
+  closepath} bdef
+/FRR {MRR stroke } bdef
+/PRR {MRR fill } bdef
+/MlrRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lry uly sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 90 270 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 270 90 arc tMatrix setmatrix
+  closepath} bdef
+/FlrRR {MlrRR stroke } bdef
+/PlrRR {MlrRR fill } bdef
+/MtbRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lrx ulx sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 180 360 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 0 180 arc tMatrix setmatrix
+  closepath} bdef
+/FtbRR {MtbRR stroke } bdef
+/PtbRR {MtbRR fill } bdef
+/stri 6 array def /dtri 6 array def
+/smat 6 array def /dmat 6 array def
+/tmat1 6 array def /tmat2 6 array def /dif 3 array def
+/asub {/ind2 exch def /ind1 exch def dup dup
+  ind1 get exch ind2 get sub exch } bdef
+/tri_to_matrix {
+  2 0 asub 3 1 asub 4 0 asub 5 1 asub
+  dup 0 get exch 1 get 7 -1 roll astore } bdef
+/compute_transform {
+  dmat dtri tri_to_matrix tmat1 invertmatrix 
+  smat stri tri_to_matrix tmat2 concatmatrix } bdef
+/ds {stri astore pop} bdef
+/dt {dtri astore pop} bdef
+/db {2 copy /cols xdef /rows xdef mul dup 3 mul string
+  currentfile 
+  3 index 0 eq {/ASCIIHexDecode filter}
+  {/ASCII85Decode filter 3 index 2 eq {/RunLengthDecode filter} if }
+  ifelse exch readstring pop
+  dup 0 3 index getinterval /rbmap xdef
+  dup 2 index dup getinterval /gbmap xdef
+  1 index dup 2 mul exch getinterval /bbmap xdef pop pop}bdef
+/it {gs np dtri aload pop moveto lineto lineto cp c
+  cols rows 8 compute_transform 
+  rbmap gbmap bbmap true 3 colorimage gr}bdef
+/il {newpath moveto lineto stroke}bdef
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox:    70   213   561   591
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: obj1
+bplot
+
+/dpi2point 12 def
+portraitMode 0216 7344 csm
+
+  628   247  5889  4541 rc
+85 dict begin %Colortable dictionary
+/c0 { 0.000000 0.000000 0.000000 sr} bdef
+/c1 { 1.000000 1.000000 1.000000 sr} bdef
+/c2 { 0.900000 0.000000 0.000000 sr} bdef
+/c3 { 0.000000 0.820000 0.000000 sr} bdef
+/c4 { 0.000000 0.000000 0.800000 sr} bdef
+/c5 { 0.910000 0.820000 0.320000 sr} bdef
+/c6 { 1.000000 0.260000 0.820000 sr} bdef
+/c7 { 0.000000 0.820000 0.820000 sr} bdef
+c0
+1 j
+1 sg
+   0    0 6913 5186 rf
+6 w
+0 4226 5356 0 0 -4226 899 4615 4 MP
+PP
+-5356 0 0 4226 5356 0 0 -4226 899 4615 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+ 899 4615 mt 6255 4615 L
+ 899  389 mt 6255  389 L
+ 899 4615 mt  899  389 L
+6255 4615 mt 6255  389 L
+ 899 4615 mt 6255 4615 L
+ 899 4615 mt  899  389 L
+1410 4615 mt 1410 4561 L
+1410  389 mt 1410  442 L
+%%IncludeResource: font Helvetica
+/Helvetica /ISOLatin1Encoding 120 FMSR
+
+1197 4760 mt 
+(1954Q4) s
+1948 4615 mt 1948 4561 L
+1948  389 mt 1948  442 L
+1735 4760 mt 
+(1959Q4) s
+2486 4615 mt 2486 4561 L
+2486  389 mt 2486  442 L
+2273 4760 mt 
+(1964Q4) s
+3025 4615 mt 3025 4561 L
+3025  389 mt 3025  442 L
+2812 4760 mt 
+(1969Q4) s
+3563 4615 mt 3563 4561 L
+3563  389 mt 3563  442 L
+3350 4760 mt 
+(1974Q4) s
+4101 4615 mt 4101 4561 L
+4101  389 mt 4101  442 L
+3888 4760 mt 
+(1979Q4) s
+4640 4615 mt 4640 4561 L
+4640  389 mt 4640  442 L
+4427 4760 mt 
+(1984Q4) s
+5178 4615 mt 5178 4561 L
+5178  389 mt 5178  442 L
+4965 4760 mt 
+(1989Q4) s
+5716 4615 mt 5716 4561 L
+5716  389 mt 5716  442 L
+5503 4760 mt 
+(1994Q4) s
+6255 4615 mt 6255 4561 L
+6255  389 mt 6255  442 L
+6042 4760 mt 
+(1999Q4) s
+ 899 4405 mt  952 4405 L
+6255 4405 mt 6201 4405 L
+ 728 4449 mt 
+(-1) s
+ 899 3725 mt  952 3725 L
+6255 3725 mt 6201 3725 L
+ 628 3769 mt 
+(-0.5) s
+ 899 3045 mt  952 3045 L
+6255 3045 mt 6201 3045 L
+ 798 3089 mt 
+(0) s
+ 899 2365 mt  952 2365 L
+6255 2365 mt 6201 2365 L
+ 698 2409 mt 
+(0.5) s
+ 899 1686 mt  952 1686 L
+6255 1686 mt 6201 1686 L
+ 798 1730 mt 
+(1) s
+ 899 1006 mt  952 1006 L
+6255 1006 mt 6201 1006 L
+ 698 1050 mt 
+(1.5) s
+ 899 4615 mt 6255 4615 L
+ 899  389 mt 6255  389 L
+ 899 4615 mt  899  389 L
+6255 4615 mt 6255  389 L
+gs 899 389 5357 4227 rc
+27 -628 27 -299 27 -259 27 -645 27 -168 27 101 27 -250 27 77 
+27 286 27 -83 27 -41 26 -264 27 164 27 -187 27 -2 27 389 
+27 139 27 73 27 47 27 -74 27 775 27 432 27 107 26 16 
+27 206 27 -135 27 -384 27 536 27 275 27 -35 27 253 27 -705 
+27 -338 27 327 27 -313 26 -59 27 130 27 376 27 33 27 -185 
+27 -424 27 551 27 -207 27 292 27 -122 27 119 26 -167 27 450 
+27 357 27 12 27 13 27 -619 27 96 27 -15 27 220 27 397 
+27 -173 27 -247 26 9 27 -37 27 171 27 -922 27 -31 27 462 
+27 -398 27 -372 27 176 27 -541 27 624 27 -315 26 -148 27 78 
+27 -174 27 127 27 35 27 -89 27 -182 27 -226 27 -159 27 82 
+27 296 26 -437 27 88 27 -339 27 370 27 358 27 -244 27 375 
+27 350 27 -303 27 -156 27 791 27 65 26 84 27 110 27 -28 
+27 -35 27 -270 27 10 27 302 27 -75 27 521 27 123 27 -561 
+27 -26 26 -212 27 133 27 420 27 -184 27 -487 27 -84 27 -272 
+27 42 27 -553 27 215 27 229 27 252 26 30 27 7 27 34 
+27 -234 27 18 27 -194 27 102 27 -15 27 -179 27 -85 27 -8 
+26 262 27 107 27 -154 27 -19 27 30 27 -99 27 -242 27 55 
+27 -125 27 -79 27 328 27 67 26 -281 27 173 27 153 27 -123 
+27 -125 27 37 27 48 27 549 27 285 27 575 27 676 27 -383 
+26 -282 27 -74 27 -184 27 -161 27 -16 27 202 27 -74 27 242 
+27 71 27 -164 27 -508 26 -168 27 82 27 18 27 -229 27 -205 
+27 -122 27 231 27 255 27 -365 27 -170 27 -298 27 221 26 -100 
+27 -268 27 113 27 -209 27 75 27 6 27 -259 27 739 27 222 
+27 -85 27 -120 27 136 26 -346 27 409 27 -167 27 -437 27 353 
+27 -144 27 33 27 -106 27 376 27 193 27 101 26 -27 899 3045 200 MP stroke
+DA
+/c8 { 1.000000 0.000000 0.000000 sr} bdef
+c8
+27 -1255 27 -568 27 -466 27 -1181 27 -220 27 293 27 -399 27 230 
+27 602 27 -147 27 -77 26 -514 27 305 27 -395 27 -39 27 691 
+27 166 27 20 27 -41 27 -274 27 1349 27 628 27 -19 26 -188 
+27 188 27 -462 27 -904 27 903 27 373 27 -225 27 342 27 -1487 
+27 -708 27 601 27 -642 26 -124 27 247 27 702 27 18 27 -401 
+27 -832 27 1062 27 -431 27 541 27 -273 27 204 26 -346 27 850 
+27 639 27 -42 27 -29 27 -1218 27 213 27 6 27 464 27 793 
+27 -320 27 -430 26 89 27 10 27 413 27 -1677 27 110 27 1048 
+27 -638 27 -554 27 515 27 -875 27 1380 27 -479 26 -146 27 287 
+27 -218 27 355 27 151 27 -103 27 -290 27 -375 27 -242 27 212 
+27 592 26 -849 27 174 27 -659 27 704 27 636 27 -555 27 641 
+27 552 27 -722 27 -410 27 1412 27 -39 26 5 27 57 27 -200 
+27 -192 27 -620 27 -44 27 526 27 -201 27 953 27 165 27 -1133 
+27 -47 26 -383 27 303 27 844 27 -340 27 -890 27 -77 27 -425 
+27 195 27 -945 27 564 27 562 27 576 26 123 27 70 27 114 
+27 -403 27 94 27 -318 27 258 27 18 27 -300 27 -110 27 37 
+26 545 27 214 27 -298 27 -35 27 52 27 -205 27 -476 27 103 
+27 -253 27 -167 27 608 27 68 26 -608 27 276 27 217 27 -328 
+27 -323 27 1 27 20 27 974 27 429 27 966 27 1117 27 -938 
+26 -688 27 -244 27 -424 27 -340 27 -30 27 401 27 -125 27 498 
+27 160 27 -280 27 -911 26 -208 27 286 27 156 27 -316 27 -254 
+27 -80 27 592 27 607 27 -607 27 -212 27 -453 27 548 26 -97 
+27 -422 27 312 27 -326 27 219 27 67 27 -449 27 1461 27 396 
+27 -217 27 -278 27 215 26 -718 27 746 27 -391 27 -892 27 652 
+27 -332 27 14 27 -255 27 668 27 283 27 88 26 -167 899 2718 200 MP stroke
+gr
+
+c8
+DA
+0 sg
+ 882 4658 mt 
+( ) s
+6239  431 mt 
+( ) s
+SO
+1 sg
+0 334 1903 0 0 -334 4293 783 4 MP
+PP
+-1903 0 0 334 1903 0 0 -334 4293 783 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+4293  783 mt 6196  783 L
+4293  449 mt 6196  449 L
+4293  783 mt 4293  449 L
+6196  783 mt 6196  449 L
+4293  783 mt 6196  783 L
+4293  783 mt 4293  449 L
+4293  783 mt 6196  783 L
+4293  449 mt 6196  449 L
+4293  783 mt 4293  449 L
+6196  783 mt 6196  449 L
+4756  583 mt 
+(Stationary component of y) s
+gs 4293 449 1904 335 rc
+356 0 4364 540 2 MP stroke
+gr
+
+4756  734 mt 
+(Filtered y) s
+gs 4293 449 1904 335 rc
+DA
+c8
+356 0 4364 691 2 MP stroke
+SO
+gr
+
+c8
+
+end %%Color Dict
+
+eplot
+%%EndObject
+
+epage
+end
+
+showpage
+
+%%Trailer
+%%EOF
diff --git a/doc/dynare.plots/HPCycle.jpg b/doc/dynare.plots/HPCycle.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b52879512d8f37ff8a5bd292922445ba0d57487d
Binary files /dev/null and b/doc/dynare.plots/HPCycle.jpg differ
diff --git a/doc/dynare.plots/HPCycle.png b/doc/dynare.plots/HPCycle.png
new file mode 100644
index 0000000000000000000000000000000000000000..4ce94af9bd8dfcb56ccd296df6da93512726319f
Binary files /dev/null and b/doc/dynare.plots/HPCycle.png differ
diff --git a/doc/dynare.plots/HPTrend.eps b/doc/dynare.plots/HPTrend.eps
new file mode 100644
index 0000000000000000000000000000000000000000..d5075bf37fe1e9b72c704683b9257fc3d58d28d5
--- /dev/null
+++ b/doc/dynare.plots/HPTrend.eps
@@ -0,0 +1,378 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: MATLAB, The MathWorks, Inc. Version 8.1.0.604 (R2013a). Operating System: Linux 3.10-3-amd64 #1 SMP Debian 3.10.11-1 (2013-09-10) x86_64.
+%%Title: ../doc/dynare.plots/HPTrend.eps
+%%CreationDate: 11/12/2013  18:39:48
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%LanguageLevel: 2
+%%Pages: 1
+%%BoundingBox:    78   213   561   591
+%%EndComments
+
+%%BeginProlog
+% MathWorks dictionary
+/MathWorks 160 dict begin
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+% operator abbreviations
+/c  /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s {show newpath} bdef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/sg /setgray ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+% orientation switch
+/portraitMode 0 def /landscapeMode 1 def /rotateMode 2 def
+% coordinate system mappings
+/dpi2point 0 def
+% font control
+/FontSize 0 def
+/FMS {/FontSize xstore findfont [FontSize 0 0 FontSize neg 0 0]
+  makefont setfont} bdef
+/reencode {exch dup where {pop load} {pop StandardEncoding} ifelse
+  exch dup 3 1 roll findfont dup length dict begin
+  { 1 index /FID ne {def}{pop pop} ifelse } forall
+  /Encoding exch def currentdict end definefont pop} bdef
+/isroman {findfont /CharStrings get /Agrave known} bdef
+/FMSR {3 1 roll 1 index dup isroman {reencode} {pop pop} ifelse
+  exch FMS} bdef
+/csm {1 dpi2point div -1 dpi2point div scale neg translate
+ dup landscapeMode eq {pop -90 rotate}
+  {rotateMode eq {90 rotate} if} ifelse} bdef
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
+  dpi2point mul] 0 setdash } bdef
+% macros for lines and objects
+/L {lineto stroke} bdef
+/MP {3 1 roll moveto 1 sub {rlineto} repeat} bdef
+/AP {{rlineto} repeat} bdef
+/PDlw -1 def
+/W {/PDlw currentlinewidth def setlinewidth} def
+/PP {closepath eofill} bdef
+/DP {closepath stroke} bdef
+/MR {4 -2 roll moveto dup  0 exch rlineto exch 0 rlineto
+  neg 0 exch rlineto closepath} bdef
+/FR {MR stroke} bdef
+/PR {MR fill} bdef
+/L1i {{currentfile picstr readhexstring pop} image} bdef
+/tMatrix matrix def
+/MakeOval {newpath tMatrix currentmatrix pop translate scale
+0 0 1 0 360 arc tMatrix setmatrix} bdef
+/FO {MakeOval stroke} bdef
+/PO {MakeOval fill} bdef
+/PD {currentlinewidth 2 div 0 360 arc fill
+   PDlw -1 eq not {PDlw w /PDlw -1 def} if} def
+/FA {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arc tMatrix setmatrix stroke} bdef
+/PA {newpath tMatrix currentmatrix pop	translate 0 0 moveto scale
+  0 0 1 5 -2 roll arc closepath tMatrix setmatrix fill} bdef
+/FAn {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arcn tMatrix setmatrix stroke} bdef
+/PAn {newpath tMatrix currentmatrix pop translate 0 0 moveto scale
+  0 0 1 5 -2 roll arcn closepath tMatrix setmatrix fill} bdef
+/vradius 0 def /hradius 0 def /lry 0 def
+/lrx 0 def /uly 0 def /ulx 0 def /rad 0 def
+/MRR {/vradius xdef /hradius xdef /lry xdef /lrx xdef /uly xdef
+  /ulx xdef newpath tMatrix currentmatrix pop ulx hradius add uly
+  vradius add translate hradius vradius scale 0 0 1 180 270 arc 
+  tMatrix setmatrix lrx hradius sub uly vradius add translate
+  hradius vradius scale 0 0 1 270 360 arc tMatrix setmatrix
+  lrx hradius sub lry vradius sub translate hradius vradius scale
+  0 0 1 0 90 arc tMatrix setmatrix ulx hradius add lry vradius sub
+  translate hradius vradius scale 0 0 1 90 180 arc tMatrix setmatrix
+  closepath} bdef
+/FRR {MRR stroke } bdef
+/PRR {MRR fill } bdef
+/MlrRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lry uly sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 90 270 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 270 90 arc tMatrix setmatrix
+  closepath} bdef
+/FlrRR {MlrRR stroke } bdef
+/PlrRR {MlrRR fill } bdef
+/MtbRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lrx ulx sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 180 360 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 0 180 arc tMatrix setmatrix
+  closepath} bdef
+/FtbRR {MtbRR stroke } bdef
+/PtbRR {MtbRR fill } bdef
+/stri 6 array def /dtri 6 array def
+/smat 6 array def /dmat 6 array def
+/tmat1 6 array def /tmat2 6 array def /dif 3 array def
+/asub {/ind2 exch def /ind1 exch def dup dup
+  ind1 get exch ind2 get sub exch } bdef
+/tri_to_matrix {
+  2 0 asub 3 1 asub 4 0 asub 5 1 asub
+  dup 0 get exch 1 get 7 -1 roll astore } bdef
+/compute_transform {
+  dmat dtri tri_to_matrix tmat1 invertmatrix 
+  smat stri tri_to_matrix tmat2 concatmatrix } bdef
+/ds {stri astore pop} bdef
+/dt {dtri astore pop} bdef
+/db {2 copy /cols xdef /rows xdef mul dup 3 mul string
+  currentfile 
+  3 index 0 eq {/ASCIIHexDecode filter}
+  {/ASCII85Decode filter 3 index 2 eq {/RunLengthDecode filter} if }
+  ifelse exch readstring pop
+  dup 0 3 index getinterval /rbmap xdef
+  dup 2 index dup getinterval /gbmap xdef
+  1 index dup 2 mul exch getinterval /bbmap xdef pop pop}bdef
+/it {gs np dtri aload pop moveto lineto lineto cp c
+  cols rows 8 compute_transform 
+  rbmap gbmap bbmap true 3 colorimage gr}bdef
+/il {newpath moveto lineto stroke}bdef
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox:    78   213   561   591
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: obj1
+bplot
+
+/dpi2point 12 def
+portraitMode 0216 7344 csm
+
+  731   247  5786  4541 rc
+85 dict begin %Colortable dictionary
+/c0 { 0.000000 0.000000 0.000000 sr} bdef
+/c1 { 1.000000 1.000000 1.000000 sr} bdef
+/c2 { 0.900000 0.000000 0.000000 sr} bdef
+/c3 { 0.000000 0.820000 0.000000 sr} bdef
+/c4 { 0.000000 0.000000 0.800000 sr} bdef
+/c5 { 0.910000 0.820000 0.320000 sr} bdef
+/c6 { 1.000000 0.260000 0.820000 sr} bdef
+/c7 { 0.000000 0.820000 0.820000 sr} bdef
+c0
+1 j
+1 sg
+   0    0 6913 5186 rf
+6 w
+0 4226 5356 0 0 -4226 899 4615 4 MP
+PP
+-5356 0 0 4226 5356 0 0 -4226 899 4615 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+ 899 4615 mt 6255 4615 L
+ 899  389 mt 6255  389 L
+ 899 4615 mt  899  389 L
+6255 4615 mt 6255  389 L
+ 899 4615 mt 6255 4615 L
+ 899 4615 mt  899  389 L
+1410 4615 mt 1410 4561 L
+1410  389 mt 1410  442 L
+%%IncludeResource: font Helvetica
+/Helvetica /ISOLatin1Encoding 120 FMSR
+
+1197 4760 mt 
+(1954Q4) s
+1948 4615 mt 1948 4561 L
+1948  389 mt 1948  442 L
+1735 4760 mt 
+(1959Q4) s
+2486 4615 mt 2486 4561 L
+2486  389 mt 2486  442 L
+2273 4760 mt 
+(1964Q4) s
+3025 4615 mt 3025 4561 L
+3025  389 mt 3025  442 L
+2812 4760 mt 
+(1969Q4) s
+3563 4615 mt 3563 4561 L
+3563  389 mt 3563  442 L
+3350 4760 mt 
+(1974Q4) s
+4101 4615 mt 4101 4561 L
+4101  389 mt 4101  442 L
+3888 4760 mt 
+(1979Q4) s
+4640 4615 mt 4640 4561 L
+4640  389 mt 4640  442 L
+4427 4760 mt 
+(1984Q4) s
+5178 4615 mt 5178 4561 L
+5178  389 mt 5178  442 L
+4965 4760 mt 
+(1989Q4) s
+5716 4615 mt 5716 4561 L
+5716  389 mt 5716  442 L
+5503 4760 mt 
+(1994Q4) s
+6255 4615 mt 6255 4561 L
+6255  389 mt 6255  442 L
+6042 4760 mt 
+(1999Q4) s
+ 899 3776 mt  952 3776 L
+6255 3776 mt 6201 3776 L
+ 798 3820 mt 
+(5) s
+ 899 2921 mt  952 2921 L
+6255 2921 mt 6201 2921 L
+ 731 2965 mt 
+(10) s
+ 899 2067 mt  952 2067 L
+6255 2067 mt 6201 2067 L
+ 731 2111 mt 
+(15) s
+ 899 1212 mt  952 1212 L
+6255 1212 mt 6201 1212 L
+ 731 1256 mt 
+(20) s
+ 899 4615 mt 6255 4615 L
+ 899  389 mt 6255  389 L
+ 899 4615 mt  899  389 L
+6255 4615 mt 6255  389 L
+gs 899 389 5357 4227 rc
+27 -29 27 -16 27 -32 27 -21 27 59 27 -35 27 18 27 -24 
+27 -16 27 -14 27 67 26 -83 27 -31 27 -48 27 -116 27 11 
+27 -38 27 -42 27 30 27 8 27 19 27 -25 27 -16 26 -75 
+27 -2 27 -16 27 8 27 -41 27 -29 27 50 27 -10 27 -38 
+27 -39 27 -13 27 -49 26 6 27 3 27 21 27 -22 27 -25 
+27 -14 27 34 27 0 27 -53 27 -9 27 -18 26 -87 27 -53 
+27 -15 27 -28 27 -54 27 -28 27 -28 27 -14 27 41 27 50 
+27 -12 27 -73 26 50 27 50 27 -44 27 8 27 -24 27 25 
+27 -42 27 -15 27 3 27 -21 27 -6 27 -74 26 -23 27 -39 
+27 -42 27 -47 27 -20 27 -18 27 -10 27 31 27 -54 27 -38 
+27 -44 26 29 27 -49 27 10 27 -38 27 -51 27 -30 27 -57 
+27 -7 27 2 27 -11 27 20 27 -44 26 -88 27 -39 27 -5 
+27 10 27 12 27 -26 27 3 27 -78 27 -23 27 -39 27 -57 
+27 -10 26 38 27 0 27 -66 27 1 27 -9 27 1 27 -27 
+27 -65 27 -12 27 -27 27 20 27 -41 26 -22 27 -20 27 27 
+27 -4 27 23 27 -43 27 -28 27 8 27 -16 27 -25 27 19 
+26 25 27 -104 27 -17 27 -14 27 -8 27 -4 27 -6 27 -35 
+27 -11 27 -25 27 -41 27 -32 26 -42 27 -36 27 -59 27 -73 
+27 5 27 -7 27 12 27 -29 27 59 27 -66 27 -75 27 -15 
+26 -23 27 -52 27 5 27 -54 27 -39 27 -47 27 9 27 13 
+27 -46 27 -9 27 -78 26 -21 27 -18 27 -55 27 -68 27 -25 
+27 -37 27 -22 27 -65 27 -29 27 -28 27 22 27 -5 26 -24 
+27 44 27 -70 27 31 27 -44 27 -17 27 -58 27 -28 27 -68 
+27 -50 27 -46 27 -56 26 -36 27 3 27 -13 27 -61 27 -50 
+27 -43 27 -56 27 14 27 -19 27 3 27 -5 26 -50 899 4592 200 MP stroke
+DA
+/c8 { 1.000000 0.000000 0.000000 sr} bdef
+c8
+27 -13 27 -13 27 -12 27 -13 27 -13 27 -13 27 -14 27 -15 
+27 -15 27 -16 27 -17 26 -18 27 -19 27 -20 27 -20 27 -21 
+27 -21 27 -20 27 -20 27 -20 27 -19 27 -19 27 -19 26 -18 
+27 -18 27 -17 27 -17 27 -17 27 -16 27 -16 27 -15 27 -15 
+27 -15 27 -15 27 -15 26 -14 27 -15 27 -15 27 -15 27 -15 
+27 -16 27 -17 27 -17 27 -18 27 -19 27 -19 26 -20 27 -20 
+27 -20 27 -20 27 -18 27 -18 27 -16 27 -15 27 -13 27 -12 
+27 -10 27 -10 26 -9 27 -8 27 -8 27 -8 27 -9 27 -10 
+27 -10 27 -12 27 -13 27 -14 27 -16 27 -17 26 -18 27 -20 
+27 -20 27 -22 27 -22 27 -22 27 -23 27 -24 27 -23 27 -25 
+27 -24 26 -24 27 -25 27 -25 27 -25 27 -25 27 -25 27 -25 
+27 -25 27 -25 27 -25 27 -24 27 -25 26 -24 27 -24 27 -24 
+27 -24 27 -23 27 -24 27 -23 27 -23 27 -23 27 -22 27 -23 
+27 -21 26 -21 27 -21 27 -20 27 -20 27 -19 27 -18 27 -18 
+27 -18 27 -17 27 -16 27 -15 27 -15 26 -14 27 -13 27 -12 
+27 -12 27 -12 27 -11 27 -12 27 -11 27 -12 27 -12 27 -12 
+26 -13 27 -14 27 -15 27 -16 27 -16 27 -17 27 -19 27 -19 
+27 -21 27 -21 27 -23 27 -24 26 -24 27 -25 27 -25 27 -26 
+27 -25 27 -26 27 -25 27 -26 27 -26 27 -26 27 -26 27 -27 
+26 -27 27 -28 27 -28 27 -28 27 -28 27 -29 27 -28 27 -29 
+27 -30 27 -30 27 -30 26 -30 27 -31 27 -31 27 -30 27 -30 
+27 -30 27 -29 27 -29 27 -28 27 -26 27 -27 27 -25 26 -26 
+27 -25 27 -26 27 -26 27 -27 27 -28 27 -29 27 -31 27 -31 
+27 -33 27 -33 27 -34 26 -35 27 -35 27 -35 27 -36 27 -36 
+27 -36 27 -35 27 -36 27 -35 27 -35 27 -35 26 -36 899 4615 200 MP stroke
+gr
+
+c8
+DA
+0 sg
+ 882 4658 mt 
+( ) s
+6239  431 mt 
+( ) s
+SO
+1 sg
+0 334 2103 0 0 -334 4092 783 4 MP
+PP
+-2103 0 0 334 2103 0 0 -334 4092 783 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+4092  783 mt 6195  783 L
+4092  449 mt 6195  449 L
+4092  783 mt 4092  449 L
+6195  783 mt 6195  449 L
+4092  783 mt 6195  783 L
+4092  783 mt 4092  449 L
+4092  783 mt 6195  783 L
+4092  449 mt 6195  449 L
+4092  783 mt 4092  449 L
+6195  783 mt 6195  449 L
+4555  583 mt 
+(Nonstationary component of y) s
+gs 4092 449 2104 335 rc
+356 0 4163 540 2 MP stroke
+gr
+
+4555  734 mt 
+(Estimated trend of y) s
+gs 4092 449 2104 335 rc
+DA
+c8
+356 0 4163 691 2 MP stroke
+SO
+gr
+
+c8
+
+end %%Color Dict
+
+eplot
+%%EndObject
+
+epage
+end
+
+showpage
+
+%%Trailer
+%%EOF
diff --git a/doc/dynare.plots/HPTrend.jpg b/doc/dynare.plots/HPTrend.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a6dcbb82de10bfd9f73151632bf33ef00d3591b7
Binary files /dev/null and b/doc/dynare.plots/HPTrend.jpg differ
diff --git a/doc/dynare.plots/HPTrend.png b/doc/dynare.plots/HPTrend.png
new file mode 100644
index 0000000000000000000000000000000000000000..cdfe46e406ec466692d314238059b70bca4df875
Binary files /dev/null and b/doc/dynare.plots/HPTrend.png differ
diff --git a/doc/dynare.texi b/doc/dynare.texi
index 56b3355dbdc11c958153494e229212feee2a0e45..6960d9a57f276e5552f6d537a9b6d87ba6f4c825 100644
--- a/doc/dynare.texi
+++ b/doc/dynare.texi
@@ -49,6 +49,13 @@
 @emph{Examples}
 @end macro
 
+@macro remarkhead
+@iftex
+@sp 1
+@end iftex
+@noindent @emph{Remark}
+@end macro
+
 @macro outputhead
 @iftex
 @sp 1
@@ -9065,14 +9072,922 @@ do2 = dseries(`filename.csv');
 do3 = dseries([1; 2; 3], 1999Q3, @{`var123'@}, @{`var_@{123@}'@});
 @end example
 
-@sp1
+@sp 1
 
 @example In a Matlab/Octave script:
-do1 = dseries(dates('1999Q3'));
-do2 = dseries(`filename.csv');
-do3 = dseries([1; 2; 3], dates('1999Q3'), @{`var123'@}, @{`var_@{123@}'@});
+>> do1 = dseries(dates('1999Q3'));
+>> do2 = dseries(`filename.csv');
+>> do3 = dseries([1; 2; 3], dates('1999Q3'), @{`var123'@}, @{`var_@{123@}'@});
+@end example
+
+@sp 1
+
+A list of the available methods, by alphabetical order, is given below.
+
+@deftypefn {dseries} {[@var{A}, @var{B}] = } align (@var{A}, @var{B})
+
+If @dseries objects @var{A} and @var{B} are defined on different time ranges, this function extends @var{A} and/or @var{B} with NaNs so that they are defined on the same time range. Note that both @dseries objects must have the same frequency.
+
+@examplehead
+@example
+>> ts0 = dseries(rand(5,1),dates('2000Q1')); % 2000Q1 -> 2001Q1
+>> ts1 = dseries(rand(3,1),dates('2000Q4')); % 2000Q4 -> 2001Q2
+>> [ts0, ts1] = align(ts0, ts1);             % 2000Q1 -> 2001Q2
+>> ts0
+ 
+ts0 is a dseries object:
+ 
+       | Variable_1
+2000Q1 | 0.81472   
+2000Q2 | 0.90579   
+2000Q3 | 0.12699   
+2000Q4 | 0.91338   
+2001Q1 | 0.63236   
+2001Q2 | NaN       
+ 
+>> ts1
+ 
+ts1 is a dseries object:
+ 
+       | Variable_1
+2000Q1 | NaN       
+2000Q2 | NaN       
+2000Q3 | NaN       
+2000Q4 | 0.66653   
+2001Q1 | 0.17813   
+2001Q2 | 0.12801
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } baxter_king_filter (@var{A}, @var{hf}, @var{lf}, @var{K})
+
+Implementation of Baxter and King (1999) band pass filter for @dseries objects. This filter isolates business cycle fluctuations with a period of length ranging between @var{hf} (high frequency) to @var{lf} (low frequency) using a symetric moving average smoother with @math{2K+1} points, so that K observations at the beginning and at the end of the  sample are lost in the computation of the filter.
+
+@examplehead
+@example
+% Simulate a component model (stochastic trend, deterministic trend, and a 
+% stationary autoregressive process).
+e = .2*randn(200,1);
+u = randn(200,1);
+stochastic_trend = cumsum(e); 
+deterministic_trend = .1*transpose(1:200);
+x = zeros(200,1);
+for i=2:200
+    x(i) = .75*x(i-1) + e(i);
+end
+y = x + stochastic_trend + deterministic_trend;
+
+% Instantiates time series objects.
+ts0 = dseries(y,'1950Q1');
+ts1 = dseries(x,'1950Q1'); % stationary component.
+
+% Apply the Baxter-King filter.
+ts2 = ts0.baxter_king_filter();
+
+% Plot the filtered time series.
+plot(ts1(ts2.dates).data,'-k'); % Plot of the stationary component.
+hold on
+plot(ts2.data,'--r');           % Plot of the filtered y.
+hold off
+axis tight
+id = get(gca,'XTick');
+set(gca,'XTickLabel',strings(ts.dates(id)));
 @end example
 
+@iftex
+@sp 1
+The previous code should produce something like:
+@center
+@image{dynare.plots/BaxterKingFilter,11.32cm,7cm}
+@end iftex
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {[@var{error_flag}, @var{message} ] = } check (@var{A})
+
+Sanity check of @dseries object @var{A}. Returns @math{1} if there is an error, @math{0} otherwise. The second output argument is a string giving brief informations about the error.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } cumsum (@var{A}[, @var{d}[, @var{v}]])
+
+Overloads the Matlab/Octave @code{cumsum} function for @dseries objects. The cumulated sum cannot be computed if the variables in @dseries object @var{A} have @code{NaN}s. If a @dates object @var{d} is provided as a second argument, then the method computes the cumulated sum with the additional constraint that the variables in the @dseries object @var{B} are zero in period @var{d}. If a single observation @dseries object @var{v} is provided as a third argument, the cumulated sum in @var{B} is such that @code{B(d)} matches @var{v}.
+
+@examplehead
+@example
+>> ts1 = dseries(ones(10,1));
+>> ts2 = ts1.cumsum();
+>> ts2
+ 
+ts2 is a dseries object:
+ 
+    | cumsum(Variable_1)
+1Y  | 1                 
+2Y  | 2                 
+3Y  | 3                 
+4Y  | 4                 
+5Y  | 5                 
+6Y  | 6                 
+7Y  | 7                 
+8Y  | 8                 
+9Y  | 9                 
+10Y | 10                
+ 
+>> ts3 = cumsum(dates('3Y'));
+>> ts3
+ 
+ts3 is a dseries object:
+ 
+    | cumsum(Variable_1)
+1Y  | -2                
+2Y  | -1                
+3Y  | 0                 
+4Y  | 1                 
+5Y  | 2                 
+6Y  | 3                 
+7Y  | 4                 
+8Y  | 5                 
+9Y  | 6                 
+10Y | 7                 
+ 
+>> ts4 = ts1.cumsum(dates('3Y'),dseries(pi));
+>> ts4
+ 
+ts4 is a dseries object:
+ 
+    | cumsum(Variable_1)
+1Y  | 1.1416            
+2Y  | 2.1416            
+3Y  | 3.1416            
+4Y  | 4.1416            
+5Y  | 5.1416            
+6Y  | 6.1416            
+7Y  | 7.1416            
+8Y  | 8.1416            
+9Y  | 9.1416            
+10Y | 10.1416
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} eq (@var{A}, @var{B})
+
+Overloads the Matlab/Octave @code{eq} (equal, @code{==}) operator. @dseries objects @var{A} and @var{B} must have the  same number of observations (say, @math{T}) and variables (@math{N}). The returned argument is a @math{T} by @math{N} matrix of zeros and ones. Element @math{(i,j)} of @var{C} is equal to @code{1} if and only if observation @math{i} for variable @math{j} in @var{A} and @var{B} are the same.
+
+@examplehead
+@example
+>> ts0 = dseries(2*ones(3,1));
+>> ts1 = dseries([2; 0; 2]);
+>> ts0==ts1
+
+ans =
+
+     1
+     0
+     1
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} exp (@var{A})
+
+Overloads the Matlab/Octave @code{exp} function for @dseries objects.
+@examplehead
+@example
+>> ts0 = dseries(rand(10,1));
+>> ts1 = ts0.exp();
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} extract (@var{A}, @var{B}[, ]...)
+
+Extracts some variables from a @dseries object @var{A} and returns a @dseries object @var{C}. The input arguments following @var{A} are strings representing the variables to be selected in the new @dseries object @var{C}. To simplify the creation of sub-objects, the @dseries class overloads the curly braces (@code{D = extract (A, B, C)} is equivalent to @code{D = A@{B,C@}}) and allows implicit loops (defined between a pair of @@ symbol, see examples below) or Matlab/Octave's regular expressions (introduced by square brackets).
+
+@exampleshead
+
+@noindent The following selections are equivalent: 
+@example
+>> ts0 = dseries(ones(100,10));
+>> ts1 = ts0@{'Variable_1','Variable_2','Variable_3'@};
+>> ts2 = ts0@{'Variable_@@1,2,3@@'@}
+>> ts3 = ts0@{'Variable_[1-3]$'@}
+>> isequal(ts1,ts2) && isequal(ts1,ts3) 
+
+ans =
+
+     1
+@end example
+
+@noindent It is possible to use up to two implicit loops to select variables:
+@example
+names = @{'GDP_1';'GDP_2';'GDP_3'; 'GDP_4'; 'GDP_5'; 'GDP_6'; 'GDP_7'; 'GDP_8'; ... 
+      'GDP_9'; 'GDP_10'; 'GDP_11'; 'GDP_12'; ...
+      'HICP_1';'HICP_2';'HICP_3'; 'HICP_4'; 'HICP_5'; 'HICP_6'; 'HICP_7'; 'HICP_8'; ...
+      'HICP_9'; 'HICP_10'; 'HICP_11'; 'HICP_12'@};
+
+ts0 = dseries(randn(4,24),dates('1973Q1'),names);
+ts0@{'@@GDP,HICP@@_@@1,3,5@@'@}
+ 
+ans is a dseries object:
+ 
+       | GDP_1    | GDP_3     | GDP_5     | HICP_1   | HICP_3   | HICP_5
+1973Q1 | 1.7906   | -1.6606   | -0.57716  | 0.60963  | -0.52335 | 0.26172
+1973Q2 | 2.1624   | 3.0125    | 0.52563   | 0.70912  | -1.7158  | 1.7792
+1973Q3 | -0.81928 | 1.5008    | 1.152     | 0.2798   | 0.88568  | 1.8927
+1973Q4 | -0.03705 | -0.35899  | 0.85838   | -1.4675  | -2.1666  | -0.62032
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{D} =} horzcat (@var{A}, @var{B}[, ]...)
+
+Overloads the @code{horzcat} Matlab/Octave's method for @dseries objects. Returns a @dseries object @var{D} containing the variables in @dseries objects passed as inputs: @var{A}, @var{B}, ... If the inputs are not defined on the same time ranges, the method add @code{NaN}s to the variables so that the variables are redefined on the smallest common time range. Note that the names in the @dseries objects passed as inputs must be different and these objects must have common frequency.
+
+@examplehead
+@example
+>> ts0 = dseries(rand(5,2),'1950Q1',@{'nifnif';'noufnouf'@});
+>> ts1 = dseries(rand(7,1),'1950Q3',@{'nafnaf'@});
+>> ts2 = [ts0, ts1];
+>> ts2
+ 
+ts2 is a dseries object:
+ 
+       | nifnif  | noufnouf | nafnaf  
+1950Q1 | 0.17404 | 0.71431  | NaN     
+1950Q2 | 0.62741 | 0.90704  | NaN     
+1950Q3 | 0.84189 | 0.21854  | 0.83666 
+1950Q4 | 0.51008 | 0.87096  | 0.8593  
+1951Q1 | 0.16576 | 0.21184  | 0.52338 
+1951Q2 | NaN     | NaN      | 0.47736 
+1951Q3 | NaN     | NaN      | 0.88988 
+1951Q4 | NaN     | NaN      | 0.065076
+1952Q1 | NaN     | NaN      | 0.50946
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } hpcycle (@var{A}[, @var{lambda}])
+
+Extracts the cycle component from a @dseries @var{A} object using Hodrick Prescott filter and returns a @dseries object, @var{B}. Default value for @var{lambda}, the smoothing parameter, is  @math{1600}.
+
+@examplehead
+@example
+% Simulate a component model (stochastic trend, deterministic trend, and a 
+% stationary autoregressive process).
+e = .2*randn(200,1);
+u = randn(200,1);
+stochastic_trend = cumsum(e); 
+deterministic_trend = .1*transpose(1:200);
+x = zeros(200,1);
+for i=2:200
+    x(i) = .75*x(i-1) + e(i);
+end
+y = x + stochastic_trend + deterministic_trend;
+
+% Instantiates time series objects.
+ts0 = dseries(y,'1950Q1');
+ts1 = dseries(x,'1950Q1'); % stationary component.
+
+% Apply the HP filter.
+ts2 = ts0.hpcycle();
+
+% Plot the filtered time series.
+plot(ts1(ts2.dates).data,'-k'); % Plot of the stationary component.
+hold on
+plot(ts2.data,'--r');           % Plot of the filtered y.
+hold off
+axis tight
+id = get(gca,'XTick');
+set(gca,'XTickLabel',strings(ts.dates(id)));
+@end example
+
+@iftex
+@sp 1
+The previous code should produce something like:
+@center
+@image{dynare.plots/HPCycle,11.32cm,7cm}
+@end iftex
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } hptrend (@var{A}[, @var{lambda}])
+
+Extracts the trend component from a @dseries @var{A} object using Hodrick Prescott filter and returns a @dseries object, @var{B}. Default value for @var{lambda}, the smoothing parameter, is  @math{1600}.
+
+@examplehead
+Using the same generating data process as in the previous example:
+@example
+ts1 = dseries(stochastic_trend + deterministic_trend,'1950Q1');
+% Apply the HP filter.
+ts2 = ts0.hptrend();
+
+% Plot the filtered time series.
+plot(ts1.data,'-k'); % Plot of the nonstationary components.
+hold on
+plot(ts2.data,'--r');           % Plot of the estimated trend.
+hold off
+axis tight
+id = get(gca,'XTick');
+set(gca,'XTickLabel',strings(ts0.dates(id)));
+@end example
+
+@iftex
+@sp 1
+The previous code should produce something like:
+@center
+@image{dynare.plots/HPTrend,11.32cm,7cm}
+@end iftex
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{C} = } insert (@var{A}, @var{B}, @var{I})
+
+Inserts variables contained in @dseries object @var{B} in @dseries object @var{A} at positions specified by integer scalars in vector @var{I}, returns augmented @dseries object @var{C}. The integer scalars in @var{I} must take values between @code{1} and @code{A.length()+1} and refers to @var{A}'s column numbers. The @dseries objects @var{A} and @var{B} need not to be defined over the same time ranges, but it is assumled that they have common frequency.
+
+@examplehead
+@example
+>> ts0 = dseries(ones(2,4),'1950Q1',{'Sly'; 'Gobbo'; 'Sneaky'; 'Stealthy'});
+>> ts1 = dseries(pi*ones(2,1),'1950Q1',{'Noddy'});
+>> ts2 = ts0.insert(ts1,3)
+
+ts2 is a dseries object:
+ 
+       | Sly | Gobbo | Noddy  | Sneaky | Stealthy
+1950Q1 | 1   | 1     | 3.1416 | 1      | 1       
+1950Q2 | 1   | 1     | 3.1416 | 1      | 1       
+
+>> ts3 = dseries([pi*ones(2,1) sqrt(pi)*ones(2,1)],'1950Q1',{'Noddy';'Tessie Bear'});
+>> ts4 = ts0.insert(ts1,[3, 4])
+
+ts4 is a dseries object:
+ 
+       | Sly | Gobbo | Noddy  | Sneaky | Tessie Bear | Stealthy
+1950Q1 | 1   | 1     | 3.1416 | 1      | 1.7725      | 1       
+1950Q2 | 1   | 1     | 3.1416 | 1      | 1.7725      | 1       
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } isempty (@var{A})
+
+Overloads the Matlab/octave's @code{isempty} function. Returns @code{1} if @dseries object @var{A} is empty, @code{0} otherwise.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{C} = } isequal (@var{A},@var{B})
+
+Overloads the Matlab/octave's @code{isequal} function. Returns @code{1} if @dseries objects @var{A} and @code{B} are identical, @code{0} otherwise.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } lag (@var{A}[, @var{p}])
+
+Returns lagged time series. Default value of @var{p}, the number of lags, is @code{1}.
+
+@exampleshead
+
+@example
+>> ts0 = dseries(transpose(1:4),'1950Q1')
+ 
+ts0 is a dseries object:
+ 
+       | Variable_1
+1950Q1 | 1         
+1950Q2 | 2         
+1950Q3 | 3         
+1950Q4 | 4
+
+>> ts1 = ts0.lag()
+ 
+ts1 is a dseries object:
+ 
+       | lag(Variable_1,1)
+1950Q1 | NaN              
+1950Q2 | 1                
+1950Q3 | 2                
+1950Q4 | 3
+
+>> ts2 = ts0.lag(2)
+ 
+ts2 is a dseries object:
+ 
+       | lag(Variable_1,2)
+1950Q1 | NaN              
+1950Q2 | NaN              
+1950Q3 | 1            
+1950Q4 | 2
+@end example
+
+@noindent @dseries class overloads the parenthesis so that @code{ts.lag(p)} can be written more compactly as @code{ts(-p)}. For instance:
+
+@example
+>> ts0.lag(1)
+ 
+ans is a dseries object:
+ 
+       | lag(Variable_1,1)
+1950Q1 | NaN              
+1950Q2 | 1                
+1950Q3 | 2                
+1950Q4 | 3
+@end example
+
+@noindent or alternatively:
+
+@example
+>> ts0(-1)
+ 
+ans is a dseries object:
+ 
+       | lag(Variable_1,1)
+1950Q1 | NaN              
+1950Q2 | 1                
+1950Q3 | 2                
+1950Q4 | 3
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn {dseries} {@var{B} = } lead (@var{A}[, @var{p}])
+
+Returns leaded time series. Default value of @var{p}, the number of leads, is @code{1}. As for the @code{lag} method, the @dseries class overloads the parenthesis so that @code{ts.lead(p)} is equivalent to @code{ts(p)}.
+
+@examplehead
+
+@example
+>> ts0 = dseries(transpose(1:4),'1950Q1');
+>> ts1 = ts0.lead()
+ 
+ts1 is a dseries object:
+ 
+       | lead(Variable_1,1)
+1950Q1 | 2                 
+1950Q2 | 3                 
+1950Q3 | 4                 
+1950Q4 | NaN               
+
+>> ts2 = ts0(2)
+ 
+ts2 is a dseries object:
+ 
+       | lead(Variable_1,2)
+1950Q1 | 3                 
+1950Q2 | 4                 
+1950Q3 | NaN               
+1950Q4 | NaN
+@end example
+
+@end deftypefn
+
+@noindent @remarkhead
+
+@noindent The overloading of the parenthesis for @dseries objects, allows to easily create new @dseries objects by copying/pasting equations declared in the @code{model} block. For instance, if an Euler equation is defined in the @code{model} block:
+@example
+model;
+    ...
+    1/C - beta/C(1)*(exp(A(1))*K^(alpha-1)+1-delta) ;
+    ...
+end;
+@end example
+@noindent and if variables @var{C}, @var{A} and @var{K} are defined as @dseries objects, then by writting:
+@example
+Residuals = 1/C - beta/C(1)*(exp(A(1))*K^(alpha-1)+1-delta) ;
+@end example 
+@noindent outside of the @code{model} block, we create a new @dseries object, called @var{Residuals}, for the residuals of the Euler equation (the conditional expectation of the equation defined in the @code{model} block is zero, but the residuals are non zero).
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} log (@var{A})
+
+Overloads the Matlab/Octave @code{log} function for @dseries objects.
+@examplehead
+@example
+>> ts0 = dseries(rand(10,1));
+>> ts1 = ts0.log();
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} merge (@var{A}, @var{B})
+
+Merges two @dseries objects @var{A} and @var{B} in @dseries object @var{C}. Objects @var{A} and @var{B} need to have common frequency but can be defined on different time ranges. If a variable, say @code{x}, is defined both in @dseries objects @var{A} and @var{B}, then the merge will select the variable @code{x} as defined in the second input argument, @var{B}. 
+
+@examplehead
+@example
+>> ts0 = dseries(rand(3,2),'1950Q1',{'A1';'A2'})
+ 
+ts0 is a dseries object:
+ 
+       | A1       | A2     
+1950Q1 | 0.42448  | 0.92477
+1950Q2 | 0.60726  | 0.64208
+1950Q3 | 0.070764 | 0.1045 
+ 
+>> ts1 = dseries(rand(3,1),'1950Q2',{'A1'})
+ 
+ts1 is a dseries object:
+ 
+       | A1      
+1950Q2 | 0.70023 
+1950Q3 | 0.3958  
+1950Q4 | 0.084905
+ 
+>> merge(ts0,ts1)
+ 
+ans is a dseries object:
+ 
+       | A1       | A2     
+1950Q1 | NaN      | 0.92477
+1950Q2 | 0.70023  | 0.64208
+1950Q3 | 0.3958   | 0.1045 
+1950Q4 | 0.084905 | NaN 
+
+>> merge(ts1,ts0)
+ 
+ans is a dseries object:
+ 
+       | A1       | A2     
+1950Q1 | 0.42448  | 0.92477
+1950Q2 | 0.60726  | 0.64208
+1950Q3 | 0.070764 | 0.1045 
+1950Q4 | NaN      | NaN
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} minus (@var{A}, @var{B})
+
+Overloads the @code{minus} (@code{-}) operator for @dseries objects, element by element substraction. If both @var{A} and @var{B} are @dseries objects, they do not need to be defined over the same time ranges. If @var{A} and @var{B} are @dseries object with @math{T_A} and @math{T_B} observations and @math{N_A} and @math{N_B} variables, then  @math{N_A} must be equal to @math{N_B} or @math{1} and  @math{N_B} must be equal to @math{N_A} or @math{1}. If @math{T_A=T_B}, @code{isequal(A.init,B.init)} returns 1 and @math{N_A=N_B}, then the @code{minus} operator will compute for each couple  @math{(t,n)}, with @math{1<=t<=T_A} and @math{1<=n<=N_A}, @code{C.data(t,n)=A.data(t,n)-B.data(t,n)}. If @math{N_B} is equal to @math{1} and @math{N_A>1}, the smaller @dseries object (@var{B}) is ``broadcast'' across the larger @dseries (@var{A}) so that they have compatible shapes, the @code{minus} operator will substract the variable defined in @var{B} to each variable in @var{A}. If @var{B} is a double scalar, then the method @code{minus} will substract @var{B} to all the observations/variables in @var{A}.
+
+@examplehead
+@example
+>> ts0 = dseries(rand(3,2));
+>> ts1 = ts0@{'Variable_2'@};
+>> ts0-ts1
+ 
+ans is a dseries object:
+ 
+   | minus(Variable_1,Variable_2) | minus(Variable_2,Variable_2)
+1Y | -0.48853                     | 0                           
+2Y | -0.50535                     | 0                           
+3Y | -0.32063                     | 0
+
+>> ts1
+ 
+ts1 is a dseries object:
+ 
+   | Variable_2
+1Y | 0.703     
+2Y | 0.75415   
+3Y | 0.54729
+
+>> ts1-ts1.data(1)
+ 
+ans is a dseries object:
+ 
+   | minus(Variable_2,0.703)
+1Y | 0                      
+2Y | 0.051148               
+3Y | -0.15572
+
+>> ts1.data(1)-ts1
+ 
+ans is a dseries object:
+ 
+   | minus(0.703,Variable_2)
+1Y | 0                      
+2Y | -0.051148              
+3Y | 0.15572
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} mrdivide (@var{A}, @var{B})
+
+Overloads the @code{mrdivide} (@code{/}) operator for @dseries objects, element by element division (like the @code{./} Matlab/Octave operator). If both @var{A} and @var{B} are @dseries objects, they do not need to be defined over the same time ranges. If @var{A} and @var{B} are @dseries object with @math{T_A} and @math{T_B} observations and @math{N_A} and @math{N_B} variables, then  @math{N_A} must be equal to @math{N_B} or @math{1} and  @math{N_B} must be equal to @math{N_A} or @math{1}. If @math{T_A=T_B}, @code{isequal(A.init,B.init)} returns 1 and @math{N_A=N_B}, then the @code{mrdivide} operator will compute for each couple  @math{(t,n)}, with @math{1<=t<=T_A} and @math{1<=n<=N_A}, @code{C.data(t,n)=A.data(t,n)/B.data(t,n)}. If @math{N_B} is equal to @math{1} and @math{N_A>1}, the smaller @dseries object (@var{B}) is ``broadcast'' across the larger @dseries (@var{A}) so that they have compatible shapes, @code{mrdivides} operator will divide each variable defined in @var{A} by the variable in @var{B}, observation per observation. If @var{B} is a double scalar, then the method @code{mrdivide} will divide all the observations/variables in @var{A} by @var{B}.
+
+@examplehead
+@example
+>> ts0 = dseries(rand(3,2))
+
+ts0 is a dseries object:
+ 
+   | Variable_1 | Variable_2
+1Y | 0.72918    | 0.90307   
+2Y | 0.93756    | 0.21819   
+3Y | 0.51725    | 0.87322   
+ 
+>> ts1 = ts0@{'Variable_2'@};
+>> ts0/ts1
+ 
+ans is a dseries object:
+ 
+   | divide(Variable_1,Variable_2) | divide(Variable_2,Variable_2)
+1Y | 0.80745                       | 1                            
+2Y | 4.2969                        | 1                            
+3Y | 0.59235                       | 1
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} mtimes (@var{A}, @var{B})
+
+Overloads the @code{mtimes} (@code{*}) operator for @dseries objects, Hadammard product (the @code{.*} Matlab/Octave operator). If both @var{A} and @var{B} are @dseries objects, they do not need to be defined over the same time ranges. If @var{A} and @var{B} are @dseries object with @math{T_A} and @math{T_B} observations and @math{N_A} and @math{N_B} variables, then  @math{N_A} must be equal to @math{N_B} or @math{1} and  @math{N_B} must be equal to @math{N_A} or @math{1}. If @math{T_A=T_B}, @code{isequal(A.init,B.init)} returns 1 and @math{N_A=N_B}, then the @code{mtimes} operator will compute for each couple  @math{(t,n)}, with @math{1<=t<=T_A} and @math{1<=n<=N_A}, @code{C.data(t,n)=A.data(t,n)*B.data(t,n)}. If @math{N_B} is equal to @math{1} and @math{N_A>1}, the smaller @dseries object (@var{B}) is ``broadcast'' across the larger @dseries (@var{A}) so that they have compatible shapes, @code{mtimes} operator will multiply each variable defined in @var{A} by the variable in @var{B}, observation per observation. If @var{B} is a double scalar, then the method @code{mtimes} will multiply all the observations/variables in @var{A} by @var{B}.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} ne (@var{A}, @var{B})
+
+Overloads the Matlab/Octave @code{ne} (equal, @code{~=}) operator. @dseries objects @var{A} and @var{B} must have the  same number of observations (say, @math{T}) and variables (@math{N}). The returned argument is a @math{T} by @math{N} matrix of zeros and ones. Element @math{(i,j)} of @var{C} is equal to @code{1} if and only if observation @math{i} for variable @math{j} in @var{A} and @var{B} are not equal.
+
+@examplehead
+@example
+>> ts0 = dseries(2*ones(3,1));
+>> ts1 = dseries([2; 0; 2]);
+>> ts0~=ts1
+
+ans =
+
+     0
+     1
+     0
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{C} =} plus (@var{A}, @var{B})
+
+Overloads the @code{plus} (@code{+}) operator for @dseries objects, element by element addition. If both @var{A} and @var{B} are @dseries objects, they do not need to be defined over the same time ranges. If @var{A} and @var{B} are @dseries object with @math{T_A} and @math{T_B} observations and @math{N_A} and @math{N_B} variables, then  @math{N_A} must be equal to @math{N_B} or @math{1} and  @math{N_B} must be equal to @math{N_A} or @math{1}. If @math{T_A=T_B}, @code{isequal(A.init,B.init)} returns 1 and @math{N_A=N_B}, then the @code{minus} operator will compute for each couple  @math{(t,n)}, with @math{1<=t<=T_A} and @math{1<=n<=N_A}, @code{C.data(t,n)=A.data(t,n)+B.data(t,n)}. If @math{N_B} is equal to @math{1} and @math{N_A>1}, the smaller @dseries object (@var{B}) is ``broadcast'' across the larger @dseries (@var{A}) so that they have compatible shapes, the @code{plus} operator will add the variable defined in @var{B} to each variable in @var{A}. If @var{B} is a double scalar, then the method @code{add} will add @var{B} to all the observations/variables in @var{A}.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} pop (@var{A}[, @var{a}])
+
+Removes variable @var{a} from @dseries object @var{A}. By default, if the second argument is not provided, the last variable is removed.
+
+@examplehead
+@example
+>> ts0 = dseries(ones(3,3));
+>> ts1 = ts0.pop('Variable_2');
+ 
+ts1 is a dseries object:
+ 
+   | Variable_1 | Variable_3
+1Y | 1          | 1         
+2Y | 1          | 1         
+3Y | 1          | 1
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} qdiff (@var{A})
+@deftypefnx{dseries} {@var{B} =} qgrowth (@var{A})
+
+Computes quaterly differences or growth rates.
+
+@examplehead
+@example
+>> ts0 = dseries(transpose(1:4),'1950Q1');
+>> ts1 = ts0.qdiff()
+ 
+ts1 is a dseries object:
+ 
+       | qdiff(Variable_1)
+1950Q1 | NaN             
+1950Q2 | 1               
+1950Q3 | 1               
+1950Q4 | 1               
+ 
+>> ts0 = dseries(transpose(1:6),'1950M1');
+>> ts1 = ts0.qdiff()
+ 
+ts1 is a dseries object:
+ 
+        | qdiff(Variable_1)
+1950M1  | NaN              
+1950M2  | NaN              
+1950M3  | NaN              
+1950M4  | 3                
+1950M5  | 3                
+1950M6  | 3                
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} rename (@var{A},@var{oldname},@var{newname})
+
+Rename variable @var{oldname} to @var{newname} in @dseries object @var{A}, returns a @dseries object.
+
+@examplehead
+@example
+>> ts0 = dseries(ones(2,2));
+>> ts1 = ts0.rename('Variable_1','Stinkly')
+ 
+ts1 is a dseries object:
+ 
+   | Stinkly | Variable_2
+1Y | 1       | 1         
+2Y | 1       | 1
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} save (@var{A}[, @var{basename}[, @var{format}]])
+
+Overloads the Matlab/Octave @code{save} function, saves @dseries object @var{A} to disk. Possible formats are @code{csv} (this is the default), @code{m} (Matlab/Octave script), and @code{mat} (Matlab binary data file). The name of the file without extension is specified by @var{basename}, by default @var{basename} is the name of the first input (namely, the @dseries object @var{A}).
+
+@examplehead
+@example
+>> ts0 = dseries(ones(2,2));
+>> ts0.save();
+@end example
+@noindent The last command will create a file @code{ts0.csv} with the following content:
+@example
+,Variable_1,Variable_2
+1Y,               1,               1
+2Y,               1,               1
+@end example
+To create a Matlab/octave script, the following command:
+@example
+>> ts0.save([],'m');
+@end example
+will produce a file @code{ts0.m} with the following content:
+@example
+% File created on 14-Nov-2013 12:08:52.
+
+FREQ__ = 1;
+INIT__ = ' 1Y';
+
+NAMES__ = {'Variable_1'; 'Variable_2'};
+TEX__ = {'Variable_{1}'; 'Variable_{2}'};
+
+Variable_1 = [
+              1
+              1];
+
+Variable_2 = [
+              1
+              1];
+@end example
+@noindent The generated (@code{csv}, @code{m}, or @code{mat}) files can be loaded when instantiating a @dseries object as explained above.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} set_names (@var{A}, @var{s1}, @var{s2}, ...)
+
+Renames variables in @dseries object @var{A}, returns a @dseries object @var{B} with new names @var{s1}, @var{s2}, @var{s3}, ... The number of input arguments after the first one (@dseries object @var{A}) must be equal to @code{A.vobs} (the number of variables in @var{A}). @var{s1} will be the name of the first variable in @var{B}, @var{s2} the name of the second variable in @var{B}, and so on.
+
+@examplehead
+@example
+>> ts0 = dseries(ones(1,3));
+>> ts1 = ts0.set_names('Barbibul',[],'Barbouille')
+ 
+ts1 is a dseries object:
+ 
+   | Barbibul | Variable_2 | Barbouille
+1Y | 1        | 1          | 1 
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {[@var{T}, @var{N} ] = } size (@var{A}[, @var{dim}])
+
+Overloads the Matlab/Octave's @code{size} function. Returns the number of observations in @dseries object @var{A} (@emph{ie} @code{A.nobs}) and the number of variables (@emph{ie} @code{A.vobs}). If a second input argument is passed, the @code{size} function returns the number of observations if @code{dim=1} or the number of variables if @code{dim=2} (for all other values of @var{dim} an error is issued).
+
+@examplehead
+@example
+>> ts0 = dseries(ones(1,3));
+>> ts0.size()
+
+ans =
+
+     1     3 
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} tex_rename (@var{A},@var{name},@var{newtexname})
+
+Redefines the tex name of variable @var{name} to @var{newtexname} in @dseries object @var{A}, returns a @dseries object.
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{B} =} uminus (@var{A})
+
+Overloads @code{uminus} (@code{-}, unary minus) for @dseries object.
+
+@examplehead
+@example
+>> ts0 = dseries(1)
+ 
+ts0 is a dseries object:
+ 
+   | Variable_1
+1Y | 1
+
+>> ts1 = -ts0
+ 
+ts1 is a dseries object:
+ 
+   | -Variable_1
+1Y | -1
+@end example
+
+@end deftypefn
+
+@sp 1
+
+@deftypefn{dseries} {@var{D} =} vertcat (@var{A}, @var{B}[, ]...)
+
+Overloads the @code{vertcat} Matlab/Octave's method for @dseries objects. This method is used to append more observations to a @dseries object. Returns a @dseries object @var{D} containing the variables in @dseries objects passed as inputs. All the input arguments must be @dseries objects with the same variables defined on @emph{different time ranges}.
+
+@examplehead
+@example
+>> ts0 = dseries(rand(2,2),'1950Q1',@{'nifnif';'noufnouf'@});
+>> ts1 = dseries(rand(2,2),'1950Q3',@{'nifnif';'noufnouf'@});
+>> ts2 = [ts0; ts1]
+ 
+ts2 is a dseries object:
+ 
+       | nifnif   | noufnouf
+1950Q1 | 0.82558  | 0.31852 
+1950Q2 | 0.78996  | 0.53406 
+1950Q3 | 0.089951 | 0.13629 
+1950Q4 | 0.11171  | 0.67865 
+@end example
+
+@end deftypefn
+
+@deftypefn{dseries} {@var{B} =} ydiff (@var{A})
+@deftypefnx{dseries} {@var{B} =} ygrowth (@var{A})
+
+Computes yearly differences or growth rates.
+
+@end deftypefn
+
+@sp 1
+
+
+
+
 
 @node Reporting
 @chapter Reporting