## Methods for Steady State of DRIPs

`DRIPs.Drip`

— Type**Summary**

A Type Structure for LQG Dynamic Rational Inattention Problems (DRIPs)

**Fields**

**Primitives of the DRIP**

```
ω : Cost of information
β : Discount factor
A : Transition matrix: x=Ax+Qu
Q : Std. Dev. matrix: x=Ax+Qu
H : Mapping of shocks to actions: v=-0.5(a'-x'H)(a-H'x)
```

**Solution of the DRIP in the Steady State**

```
ss : Steady State Solution as a SteadyState type
See also: [`SteadyState`](@ref)
```

`DRIPs.Drip`

— Method`Drip(ω,β,A,Q,H; kwargs...) -> Drip`

Solves for the steady state of a Dynamic Rational Inattention Problem (DRIP) defined by the arguments and stores the solution in a Drip type. See Afrouzi and Yang (2019) for details.

**Arguments**

The function takes the primitives of the Drip as arguments:

```
* ω : Cost of information
* β : Discount factor
* A : Transition matrix: x=Ax+Qu
* Q : Std. Dev. matrix: x=Ax+Qu
* H : Mapping of shocks to actions: v=-0.5(a'-x'H)(a-H'x)
```

**Optional Arguments (kwargs...)**

Default values are set unless specified otherwise by user.

```
* fcap [= false] [if `true` then solves the problem with fixed capacity = ω bits]
* Ω0 [= H*H'] [initial guess for steady state information matrix]
* Σ0 [= A*A'+Q*Q'][initial guess for steady state prior]
* w [= 1] [updating weight on the new guess in iteration]
* tol [= 1e-4] [tolerance level for convergence]
* maxit [= 10000] [maximum number of iterations]
```

**Outputs**

The function returns a `Drip`

structure with the primitives and the solution objects:

```
* Y : Weight vector for evolution of actions
* Σ_z : Covariance matrix of the rational inattention error
* K : Kalman gain matrix
* Σ_1 : Steady-state prior covariance matrix under the solution
* Σ_p : Steady-state posterior covariance matrix under the solution
* Ω : Dynamic benefit matrix
```

**Examples**

`julia> P = Drip(ω,β,A,Q,H)`

`DRIPs.SteadyState`

— Type**Summary**

`A type srtucture for storing the steady state solution of a Drip.`

**Fields**

```
K : Kalman gain matrix
Y : Weight vector for evolution of actions
Σ_z : Covariance matrix of the rational inattention error
Σ_p : Steady-state posterior covariance matrix under the solution
Σ_1 : Steady-state prior covariance matrix under the solution
Ω : Dynamic benefit matrix
err : Convergence error for the solution
```

## Methods for Transition dynamics of DRIPs

`DRIPs.Trip`

— Type**Summary**

A Structure for the Transition dynamics of Rational Inattention Problems (TRIPs)

**Fields**

```
T : length of TRIP
Σ_1s : sequence of prior covariance matrices
Σ_ps : sequence of posterior covariance matrices
Ωs : sequence of information benefit matrices
Ds : eigenvalues of Σ_t^(0.5)Ω_tΣ_t^(0.5) over time (marginal values of information)
err : convergence error for shooting algorithm
con_err : convergence error for the steady state prior
```

`DRIPs.Trip`

— Method```
Trip(p::Drip, # steady state of D.R.I.P.
Σ0::Array{Float64,2}; # initial prior matrix
T = 100, # optional: guess for time until convergence to steady state
tol = 1e-4, # optional: tolerance for convergence
maxit = 1000 # optional: max iterations
) -> Trip
```

Solves for the transition dynamics of the optimal information structure starting from the initial prior distribution with covariance matrix `Σ0`

. See Afrouzi and Yang (2019) for details.

**Outputs**

Returns a `Trip`

structure with the steady state and transition path of the optimal information structure.

**Examples**

```
julia> p = solve_drip(ω,β,A,Q,H)
julia> Σ0 = 0.1*p.Σ_1;
julia> Pt = solve_trip(p,Σ0);
```

`DRIPs.Trip`

— Method```
Trip(p::Drip, # steady state of D.R.I.P.
S::Signal; # information treatment in the steady state
T = 100, # optional: guess for time until convergence to steady state
tol = 1e-4, # optional: tolerance for convergence
maxit = 1000 # optional: max iterations
) -> Trip
```

Solves for the transition dynamics of the optimal information structure starting from a one time treatment with a signal `S`

in the steady state. See Afrouzi and Yang (2019) for details.

**Outputs**

Returns a `Trip`

structure with the steady state and transition path of the optimal information structure.

**Examples**

```
julia> p = Drip(ω,β,A,Q,H)
julia> S = Signal(L,Σ_z);
julia> pt = Trip(p,S);
```

`DRIPs.Signal`

— Type**Summary**

A Signal Structure for Information Treatments in DRIPs. The structure encodes the signal `S = L'*x+z, z₀~N(0,Σ_z)`

.

**Fields**

- L : loading of the signal on
`x`

- Σ_z : variance covariance matrix of the noise

## Methods for Impulse Response Functions

`DRIPs.irfs`

— Method```
irfs(p :: Drip, # Steady state of the DRIP (when treatment happens)
S :: Signal; # Signal for treatment
T :: Integer = 40, # optional: length of irfs
reoptimize :: Bool = true, # if true gives the irfs with reoptimized signals, if false with steady state signals
trip :: Union{Trip, Nothing} = nothing # if false solves the trip, if = P::trip then takes P as the trip
)
```

Returns a `Path`

structure with the impulse response functions of the fundamental (`x`

), beliefs (`x_hat`

) and actions (`a`

) to all the structural shocks **under the information structure implied by a one time information treatment with** `S`

**in the steady state of the DRIP** `P`

. In particular, if `n`

is the dimension of `x`

, `m`

is the dimension of `a`

and `k`

is the number of structural shocks, then

`x`

has dimension`n*k*T`

where`x(i,j,:)`

is the impulse response function of the`i`

'th dimension of`x`

to the`j`

'th structural shock.`x_hat`

has dimension`n*k*T`

where`x_hat(i,j,:)`

is the impulse response function of the agent's average belief about the`i`

'th dimension of`x`

to the`j`

'th structural shock.`a`

has dimension`m*k*T`

where`a(i,j,:)`

is the impulse response function of the`i`

'th action to the`j`

'th structural shock.

`DRIPs.irfs`

— Method```
irfs(p :: Drip; # Steady state of the DRIP
T :: Integer = 40 # Optional: length of impulse response functions
) -> Path
```

Returns a `Path`

structure with the impulse response functions of the fundamental (`x`

), beliefs (`x_hat`

) and actions (`a`

) to all the structural shocks **under the steady state information strucutre**. In particular, if `n`

is the dimension of `x`

, `m`

is the dimension of `a`

and `k`

is the number of structural shocks, then

`x`

has dimension`n*k*T`

where`x(i,j,:)`

is the impulse response function of the`i`

'th dimension of`x`

to the`j`

'th structural shock.`x_hat`

has dimension`n*k*T`

where`x_hat(i,j,:)`

is the impulse response function of the agent's average belief about the`i`

'th dimension of`x`

to the`j`

'th structural shock.`a`

has dimension`m*k*T`

where`a(i,j,:)`

is the impulse response function of the`i`

'th action to the`j`

'th structural shock.

`DRIPs.irfs`

— Method```
irfs(pt :: Trip; # Transition dynamics of the DRIP
T :: Integer = 40 # Optional: length of impulse response functions
) -> Path
```

Returns a `Path`

structure with the impulse response functions of the fundamental (`x`

), beliefs (`x_hat`

) and actions (`a`

) to all the structural shocks **under the information structure implied by** `P`

. In particular, if `n`

is the dimension of `x`

, `m`

is the dimension of `a`

and `k`

is the number of structural shocks, then

`x`

has dimension`n*k*T`

where`x(i,j,:)`

is the impulse response function of the`i`

'th dimension of`x`

to the`j`

'th structural shock.`x_hat`

has dimension`n*k*T`

where`x_hat(i,j,:)`

is the impulse response function of the agent's average belief about the`i`

'th dimension of`x`

to the`j`

'th structural shock.`a`

has dimension`m*k*T`

where`a(i,j,:)`

is the impulse response function of the`i`

'th action to the`j`

'th structural shock.

`DRIPs.Path`

— Type**Summary**

A Structure for the irfs/simulations of DRIPs

**Fields**

```
T : length of IRFs/simulation
x : IRFs/simulation of the fundamental shocks
x_hat : IRFs/simulation of beliefs
a : IRFs/simulation of actions
```

In particular, if `n`

is the dimension of `x`

, `m`

is the dimension of `a`

and `k`

is the number of structural shocks, then

`x`

has dimension`n*k*T`

where`x(i,j,:)`

is the impulse response function of the`i`

'th dimension of`x`

to the`j`

'th structural shock.`x_hat`

has dimension`n*k*T`

where`x_hat(i,j,:)`

is the impulse response function of the agent's average belief about the`i`

'th dimension of`x`

to the`j`

'th structural shock.`a`

has dimension`m*k*T`

where`a(i,j,:)`

is the impulse response function of the`i`

'th action to the`j`

'th structural shock.

## Methods for Simulating DRIPs

`DRIPs.simulate`

— Method```
simulate(p :: Drip;
T :: Integer = 500, # Optional: length of simulation
burn :: Integer = 100, # Optional: length of initial burn (in addition to T)
N :: Union{Int4,Nothing} = nothing, # Optional: number of simulated agents (returns the average beliefs of a large set of agents by default)
seed :: Union{Integer,Nothing} = nothing # Optional: seed number for fundamental shocks
) -> Path
```

Returns a `Path`

structure with a simulated path of the fundamental (`x`

), beliefs (`x_hat`

) and actions (`a`

) **under the steady state information structure**. In particular, if `n`

is the dimension of `x`

and `m`

is the dimension of `a`

, then

`x`

has dimension`n*T`

where`x(:,t)`

is the simulated value of`x`

at time`t`

.`x_hat`

has dimension`n*T*N`

where`x_hat(:,i,t)`

is the simulated value of`x_hat`

of agent`i`

at time`t`

.`a`

has dimension`m*T*N`

where`a(:,i,t)`

is the the simulated value of`x_hat`

of agent`i`

at time`t`

.

## Aux. Functions

`DRIPs.capacity`

— Method```
capacity(P::Drip; # Drip structure
unit = "bit" # optional: unit of capacity (bit or nat).
)
```

Returns the amount of information processes per unit of time in the steady state of the DRIP `P`

.

`DRIPs.infinitesum`

— Method`infinitesum(func; tol = 1e-6,maxit = 1000,start=0)`

Returns the infinite sum `Σₓfunc(x)`

starting from `x = start`

up to tolderance `tol`

or max iteration `maxit`

.