build_SS: Function for building a state space representation to be used...

Description Usage Arguments Details Value Author(s) References

View source: R/Build_SS.R

Description

This function builds a state space representation to be used in the CESKalman_Estimation, CESKalman, and CESKalman_Bootstrap functions.

Usage

1
build_SS(param,X,nlags,lambda,Leontief=FALSE,sigma_init,alpha_init)

Arguments

param

Parameter values of the observation and state variance (see details)

X

A matrix of all explanatory variables to be used (See details)

nlags

Number of lags used of relative prices and relative budget shares. One of 0,1,2.

lambda

The inverse of the signal-to-noise ratio. Can be any positive value larger than zero. If set to NA it is estimated

Leontief

TRUE or FALSE (default). Should the elasticity of substitution be fixed at zero? If so, set =TRUE

sigma_init

Initial value for the long run elasticity of substitution, σ

alpha_init

Initial value for the adjustment parameter in the ECM, α

Details

This function builds a state space representation to be used in the CESKalman_Estimation, CESKalman, and CESKalman_Bootstrap functions. It is in particular suitable for production functions with two different production factors where one of the factors is persistent, but can be used in any CES function with two factors.

The estimated function is the Error-Correction model from Kronborg et al (2019): Δ s_{t}=α(s_{t-1}-(1-σ)p_{t-1}-μ_{t-1})+∑_{i=0}^{nlags}κ_{i}Δ p_{t-i}+∑_{i=1}^{nlags}γ_{i}Δ s_{t-i}+ε_t. s_t is the relative budget shares in logs (expenditure on factor 1 relative to factor 2), p_t is the relative prices in logs and μ_t=(σ-1)log(Γ_t) where Γ_t is the relative augmenting technical change. The process of μ_t, the state variable, is an I(2) process: Δ μ_t=Δ μ_{t-1}+η_t.

param can be a string of length 1 or 2. If lambda is freely estimated (set to NA) both param[1] (variance of error term in observation equation, ε_t) and param[2] (variance of the error term in the relative augmenting technologies, η_t) are used. Else, only param[1] is used and λΣ^η=Σ^ε. Note that the variances are specified such that Σ^ε=exp(param[1]) and Σ^η=exp(param[2]) to ensure that the variances are positive. We refer to Kronborg et al (2019) for further description of the methodology.

X should be a matrix with all the explanatory variables to be used (all in logs). The dimension is TxK, where T is time periods and K are the explanatory variables (not counting technical change as one). K=3 when nlags=0, =5 when nlags=1 and =7 when nlags=2. The column ordering should be: 1: lags of relative budget shares in log-levels. 2: lags of the relative prices in log-levels. 3: First-difference of log relative prices. 4: First-differences of log relative prices lagged one period. 5: First-differences of log relative budget shares lagged one period. 6: First-differences of log relative prices lagged two periods. 7: First-differences of log relative budget shares lagged two periods. When using the CESKalman function, data will be ordered in this way automatically.

Value

A list of class 'dlm' with all vectors and matrices to be used in the functions dlmMLE and dlmSmooth. We refer to Petris et al (2010) for further description.

Author(s)

Christian Sandholm Kastrup <CST@dreamgruppen.dk> , Anders Farver Kronborg <ANK@dreamgruppen.dk> and Peter Philip Stephensen <PSP@dreamgruppen.dk>

References

Kronborg et al (2019) and Petris et al (2010)


CKastrup/CESKalman documentation built on Jan. 26, 2022, 9:09 a.m.