Learn R Programming

meboot (version 1.0-2)

checkConv: Check Convergence

Description

This function generates a 3D array giving (Xn-X) in the notation of the ConvergenceConcepts package by Lafaye de Micheaux and Liquet for sample paths with dimensions $=$ n999 as first dimension, nover $=$ range of n values as second dimension and number of items in key as the third dimension. It is intended to be used for checking convergence of meboot in the context of a specific real world time series regression problem.

Usage

checkConv (y, bigx, trueb = 1, n999 = 999, nover = 5, 
  seed1 = 294, key = 0, trace = FALSE)

Arguments

Value

A 3 dimensional array giving (Xn-X) for sample paths with dimensions $=$ n999 as first dimension, nover $=$ range of n values as second dimension and number of items in key as the third dimension ready for use in ConvergenceConcepts package.

Details

Use this only when lagged dependent variable is absent.

Warning: key=0 might use up too much memory for large regression problems.

The algorithm first creates data on the dependent variable for a simulation using known true values denoted by trueb. It proceeds to create n999 regression problems using the seven-step algorithm in meboot creating n999 time series for all variable in the simulated regression. It then creates sample paths over a range of n values for coefficients of interest denoted as key (usually a subset of original coefficients). For each key coefficient there are n999 paths as n increases. If meboot algorithm is converging to true values, the value of (Xn-X) based criteria for "convergence in probability" and "almost sure convergence" in the notation of the ConvergenceConcepts package should decline. The decline can be plotted and/or tested to check if it is statistically significant as sample size increases. This function permits the user of meboot working with a short time series to see if the meboot algorithm is working in his or her particular situation.

References

Lafaye de Micheaux, P. and Liquet, B. (2009), Understanding Convergence Concepts: a Visual-Minded and Graphical Simulation-Based Approach, The American Statistician, 63(2) pp. 173-178.

Vinod, H.D. (2006), Maximum Entropy Ensembles for Time Series Inference in Economics, Journal of Asian Economics, 17(6), pp. 955-978

Vinod, H.D. (2004), Ranking mutual funds using unconventional utility theory and stochastic dominance, Journal of Empirical Finance, 11(3), pp. 353-377.

See Also

meboot, criterion.

Examples

Run this code
library(strucchange)
data("PhillipsCurve")

uk <- window(PhillipsCurve, start = 1948)
attach(data.frame(uk))
y <- uk[,5]
bigx <- cbind(dp1,du,u1) # collect all regressors
reg1 <- lm(y ~ bigx)
coef(reg1)
nover <- 16 #choose range allowing n=25, 26, .. , 40

# the following step will take some time to run

sC <- checkConv(y, bigx, trueb=0, n999=999, nover=nover, seed1=294) 

dim(sC) # n999 x nover x length(key)
j <- 3  # choose key coefficient no. 3 for lagged income
epsilon <- 0.1  #needed for p.as.plot command below
nb.sp <- 10 # needed for p.as.plot command below 
mode <- "p"  # needed for p.as.plot command below

# criterion function in ConvergenceConcepts package wants 999 rows
dat <- sC[,,j] # 999 sample paths for diff inflation n=25,26,..40
critp <- criterion(data = dat, epsilon = epsilon, mode = "p")$crit
critas <- criterion(data = dat, epsilon = epsilon, mode = "as")$crit

p.as.plot(dat, critp, critas, epsilon, nb.sp, mode = mode)  
nstart <- length(y) - nover + 1
nn <- seq(nstart, length(y))  # choose the range of n the sample size

opar <- par(mfrow = c(2,1)) #plot 2 plots in one
plot(nn,critp, typ="l", 
  main="Convergence in probability: Diff(Inflation) Coefficient",
  xlab="Sample size", ylab="Criterion using 999 sample paths")
plot(nn,critas, typ="l", 
  main="Almost sure convergence:  Diff(Inflation) Coefficient",
  xlab="Sample size", ylab="Criterion using 999 sample paths")

par(opar) # reset

regp <- lm(critp ~ nn) # OLS of conv. in prob. criterion
sup <- summary(regp) # regressed on sample size
sup$coef
# slope coeff. should be negative in sign for convergence
# the t statistic on the slope coefficient should be large
regas <- lm(critas ~ nn) #OLS of almost sure conv criterion
suas <- summary(regas)#regressed on sample size
suas$coef
# slope coeff. should be negative in sign for convergence
# the t statistic on the slope coefficient should be large

Run the code above in your browser using DataLab