MyNixOS website logo
Description

Discretization of AR(1).

Discretize AR(1) process following Tauchen (1986) <http://www.sciencedirect.com/science/article/pii/0165176586901680>. A discrete Markov chain that approximates in the sense of weak convergence a continuous-valued univariate Autoregressive process of first order is generated. It is a popular method used in economics and in finance.

Rtauchen

Build Status CRAN_Status_Badge

RTauchen uses Tauchen's (1986) method for discretizing AR(1) processes by choosing a finite set of points and transition probabilities, so the resulting finite-state Markov Chain mimics the original process. This method is computationally faster and numerically more stable than other methods (for example, Gaussian quadrature). This method is very popular in computational macroeconomics (See for example Deaton (1989), Sargent and Ljungqvist (2012) and Aiyagari (1994)).

Installation

# CRAN install
install.packages("Rtauchen")

# Github installation
# install.packages("devtools")
devtools::install_github("davidzarruk/Rtauchen")

Example 1

This example computes the transition probability matrix of the finite-state Markov chain approximation of an AR(1) process with: n = 5 (points in the Markov chain), ssigma = 0.02, lambda = 0.95, m = 3

results = Rtauchen(5, 0.02, 0.98, 3)

results
#               [,1]         [,2]         [,3]         [,4]         [,5]
# [1,]  9.997372e-01 2.627787e-04 0.000000e+00 0.000000e+00 0.000000e+00
# [2,]  4.433929e-05 9.998073e-01 1.483662e-04 0.000000e+00 0.000000e+00
# [3,]  6.080528e-30 8.198697e-05 9.998360e-01 8.198697e-05 0.000000e+00
# [4,]  2.785418e-78 3.349819e-29 1.483662e-04 9.998073e-01 4.433929e-05
# [5,] 3.015878e-150 4.649139e-77 1.804292e-28 2.627787e-04 9.997372e-01

Example 2

This example computes the grid of points of the finite-state Markov chain approximation of an AR(1) process with: n = 5 (points in the Markov chain), ssigma = 0.02, lambda = 0.95, m = 3

results = Tgrid(5, 0.02, 0.98, 3)

results
# [1] -0.3015113 -0.1507557  0.0000000  0.1507557  0.3015113

Metadata

Version

1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows