CESKalman_Bootstrap: Function for bootstrapping confidence intervals of the...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/CESKalman_Bootstrap.R

Description

The function uses a recursive-design bootstrapping procedure to produce confidence intervals of the elasticity of substitution and adjustment parameter. The CESKalman_Estimation function is applied and estimated for every new draw.

Usage

1
2
CESKalman_Bootstrap(Estimation,grid.param_init=c(-9,-1,3),ndraw=1000,print_results=TRUE,
                           cVal_Auto=0.1,cVal_NIS=0.1)

Arguments

Estimation

An object of class CESKalman

grid.param_init

A vector of initial Parameter values of the observation variance to loop over (see details)

ndraw

The number of draws in the bootstrapping procedure, 1000 is default.

cVal_NIS

Critical value for the NIS test

print_results

Should results be printed while bootstrapping?

cVal_auto

Critical value for the Breusch-Godfrey test for autocorrelation

Details

This function takes an object of class CESKalman as input and calls the function CESKalman_Estimation for every new draw. The parameter estimates from CESKalman are used as initial values of sigma and alpha. Also, the number of lags and lambda are determined by the CESKalman function.

grid.param_init can be a vector of any length. Values to loop over for the variance of error term in observation equation, ε_t, in the numerical optimization. When lambda is FALSE, differen values for the signal-to-noise ratio in the range from 10-1000 found to be optimal in Kronborg et al (2019) are tried. The one that maximizes the likelihood is chosen.

Only draws with no autocorrelation in the estimated model and the NIS test within the limits specified in cVal_NIS is accepted.

Value

Returns a matrix of dimension ndrawX3. First column is the draws of sigma, second is the draws of alpha and third is the likelihood value.

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) and Kastrup et al (2021)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## First, data is loaded with the Load_Data function (or any other data set)
data = Load_Data(Country="USA",tstart=1970,tend=2017)

data = cbind(data[,"q"],data[,"w"],data[,"K"],data[,"L"])

## Next, the CESKalman function is called
Kalman = CESKalman(data=data,grid.lambda=c(10,500,20), lambda_est_freely=TRUE)

## Bootstrapping confidence intervals
Bootstrap = CESKalman_Bootstrap(Estimation=Kalman)

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