Running 'SunHenKum.R' [146s]
  Running 'xMult.R' [138s]
Running the tests in 'tests/SunHenKum.R' failed.
Complete output:
  > ## This script reproduces some of the results of
  > ## Sun, K., Henderson, D.J. and Kumbhakar, S.C. (2011),
  > ## Biases in approximating log production.
  > ## Journal of Applied Econometrics, forthcoming.
  > ## doi: 10.1002/jae.1229
  > ##
  > ## This paper is in fact a replication study of
  > ## Masanjala, W.H. and Papageorgiou, C. (2004), 
  > ## The Solow model with CES technology: nonlinearities and parameter 
  > ## heterogeneity. Journal of Applied Econometrics, 19: 171–201.
  > ## doi: 10.1002/jae.722
  > ##
  > ## The data used in the two above-mentioned papers are actually from
  > ## Durlauf, S.N. and Johnson, P.A. (1995),
  > ## Multiple Regimes and Cross-Country Growth Behavior. 
  > ## Journal of Applied Econometrics, 10: 365–384.
  > 
  > # load the "micEconCES" package
  > library( "micEconCES" )
  Loading required package: minpack.lm
  Loading required package: DEoptim
  Loading required package: parallel
  
  DEoptim package
  Differential Evolution algorithm in R
  Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich
  
  Loading required package: car
  Loading required package: carData
  
  To cite package 'micEconCES' in publications use:
    Henningsen, Arne, Géraldine Henningsen, and Gergő Literáti (2021):
    Econometric Estimation of the 'Constant Elasticity of Substitution'
    Function in R: the micEconCES Package. In Hashimzade, N. and M.
    Thornton (editors), Handbook of Research Methods and Applications in
    Empirical Microeconomics. Edward Elgar, p. 596–640.
    https://doi.org/10.4337/9781788976480.00030 (open access:
    https://bit.ly/3I5U310).
  
  If you have questions, suggestions, or comments regarding the 'micEconCES' package, please use the 'issue' tracker at the GitHub page of the package:
  https://github.com/micEcon/micEconCES
  > options( digits = 3 )
  > 
  > # load data (included in the "AER" package)
  > data( "GrowthDJ", package = "AER" )
  > 
  > # remove data from oil producing countries
  > # as this has been done by Masanjala and Papageorgiou (2004)
  > # and hence, also by Sun, Henderson, and Kumbhakar (2011)
  > GrowthDJ <- subset( GrowthDJ, oil == "no" )
  > 
  > # calculate "input" variables for the Solow growth model
  > GrowthDJ$x1 <- 1
  > GrowthDJ$x2 <- ( GrowthDJ$popgrowth + 5 ) / GrowthDJ$invest
  > 
  > # CES: non-linear least-squares estimation (NLLS)
  > cesNls <- cesEst( "gdp85", c( "x1", "x2"), data = GrowthDJ )
  > summary(cesNls)
  Estimated CES function with constant returns to scale
  
  Call:
  cesEst(yName = "gdp85", xNames = c("x1", "x2"), data = GrowthDJ)
  
  Estimation by non-linear least-squares using the 'LM' optimizer
  assuming an additive error term
  Convergence achieved after 23 iterations
  Message: Relative error in the sum of squares is at most `ftol'. 
  
  Coefficients:
        Estimate Std. Error t value Pr(>|t|)  
  gamma  646.141    549.993    1.17    0.240  
  delta    3.977      2.239    1.78    0.076 .
  rho     -0.197      0.166   -1.19    0.235  
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 3314 
  Multiple R-squared: 0.602 
  
  Elasticity of Substitution:
              Estimate Std. Error t value Pr(>|t|)    
  E_1_2 (all)    1.245      0.257    4.84  1.3e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  > cesNlsCoef <- coef( cesNls )
  > delta <- cesNlsCoef[ "delta" ]
  > rho <- cesNlsCoef[ "rho" ]
  > print( alpha <- ( delta - 1 ) / delta )
  delta 
  0.749 
  > print( sigma <- 1 / ( 1 - rho ) )
    rho 
  0.835 
  > cesNlsVar <- vcov(cesNls)
  > # deltamethod(~-x2/(1-x2), cesNlsCoef, cesNlsVar)
  > # deltamethod(~1/(1-x3), cesNlsCoef, cesNlsVar)
  > 
  > # Cobb-Douglas: non-linear least-squares estimation (NLLS)
  > cdNls <- cesEst( "gdp85", c( "x1", "x2"), data = GrowthDJ, rho = 0 )
  > summary(cdNls)
  Estimated CES function with constant returns to scale
  
  Call:
  cesEst(yName = "gdp85", xNames = c("x1", "x2"), data = GrowthDJ, 
      rho = 0)
  
  Estimation by non-linear least-squares using the 'LM' optimizer
  assuming an additive error term
  Coefficient 'rho' was fixed at 0 
  Convergence achieved after 7 iterations
  Message: Relative error in the sum of squares is at most `ftol'. 
  
  Coefficients:
        Estimate Std. Error t value Pr(>|t|)    
  gamma 1288.080    543.177    2.37  0.01772 *  
  delta    2.443      0.695    3.51  0.00044 ***
  rho      0.000      0.161    0.00  1.00000    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 3342 
  Multiple R-squared: 0.595 
  
  Elasticity of Substitution:
              Estimate Std. Error t value Pr(>|t|)    
  E_1_2 (all)    1.000      0.161    6.22  5.1e-10 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  > cdNlsCoef <- coef( cdNls )
  > delta <- cdNlsCoef[ "delta" ]
  > print( alpha <- ( delta - 1 ) / delta )
  delta 
  0.591 
  > 
  > # Cobb-Douglas: estimation with logs
  > cdLog <- cesEst( "gdp85", c( "x1", "x2"), data = GrowthDJ, rho = 0, multErr = TRUE )
  Warning message:
  In log(gammaStar) : NaNs produced
  > summary(cdLog)
  Estimated CES function with constant returns to scale
  
  Call:
  cesEst(yName = "gdp85", xNames = c("x1", "x2"), data = GrowthDJ, 
      multErr = TRUE, rho = 0)
  
  Estimation by non-linear least-squares using the 'LM' optimizer
  assuming a multiplicative error term
  Coefficient 'rho' was fixed at 0 
  Convergence achieved after 8 iterations
  Message: Relative error in the sum of squares is at most `ftol'. 
  
  Coefficients:
        Estimate Std. Error t value Pr(>|t|)    
  gamma  965.234    120.400    8.02  1.1e-15 ***
  delta    2.488      0.304    8.19  2.5e-16 ***
  rho      0.000      0.106    0.00        1    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 0.681 
  Multiple R-squared: 0.597 
  
  Elasticity of Substitution:
              Estimate Std. Error t value Pr(>|t|)    
  E_1_2 (all)    1.000      0.106    9.47   <2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  > cdLogCoef <- coef( cdLog )
  > delta <- cdLogCoef[ "delta" ]
  > print( alpha <- ( delta - 1 ) / delta )
  delta 
  0.598 
  > 
  > 
  > proc.time()
     user  system elapsed 
     2.17    0.21    2.35 
Running the tests in 'tests/xMult.R' failed.
Complete output:
  > # load the micEconCES package
  > library( "micEconCES" )
  Loading required package: minpack.lm
  Loading required package: DEoptim
  Loading required package: parallel
  
  DEoptim package
  Differential Evolution algorithm in R
  Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich
  
  Loading required package: car
  Loading required package: carData
  
  To cite package 'micEconCES' in publications use:
    Henningsen, Arne, Géraldine Henningsen, and Gergő Literáti (2021):
    Econometric Estimation of the 'Constant Elasticity of Substitution'
    Function in R: the micEconCES Package. In Hashimzade, N. and M.
    Thornton (editors), Handbook of Research Methods and Applications in
    Empirical Microeconomics. Edward Elgar, p. 596–640.
    https://doi.org/10.4337/9781788976480.00030 (open access:
    https://bit.ly/3I5U310).
  
  If you have questions, suggestions, or comments regarding the 'micEconCES' package, please use the 'issue' tracker at the GitHub page of the package:
  https://github.com/micEcon/micEconCES
  > options( digits = 3 )
  > 
  > # seed for random number generation
  > set.seed( 123 )
  > 
  > # number of observations
  > nObs <- 200
  > 
  > # number of explanatory variables
  > nExog <- 4
  > 
  > # create data set
  > cesData <- data.frame( obsNo = 1:nObs )
  > 
  > # names of explanatory variables
  > xxNames <- paste( "xx", 1:nExog, sep = "." )
  > 
  > # add explanatory variables
  > for( i in 1:nExog ) {
  +    cesData[[ xxNames[ i ] ]] <- rchisq( nObs, 10 + i )
  + }
  > cesData$time <- c( 0:( nObs - 1 ) )
  > 
  > # coefficients
  > cesCoef <- c( 1, 1:nExog / sum( 1:nExog ), 0.5, 1.1 )
  > names( cesCoef ) <- c( "gamma", paste( "delta", 1:nExog, sep = "_" ),
  +    "rho", "nu" )
  > cesCoefTc <- c( cesCoef[ 1 ], lambda = 0.015, cesCoef[ -1 ] )
  > 
  > # calculate deterministic endogenous variable
  > cesData$y <- cesCalc( xNames = xxNames, data = cesData, coef = cesCoef )
  > print( cesData$y )
    [1] 14.85 11.97 10.74 14.88 15.54 14.94 20.81  9.80 26.79 10.65 15.97 13.43
   [13] 11.34 23.38 20.15  9.89 14.45 15.38 11.97 17.53 14.98 12.05 10.22 15.43
   [25] 10.43 14.47 11.69 17.60 17.82 21.03 16.71 10.06 18.46 21.89 18.07  8.76
   [37] 14.21 13.08 19.41 12.22 11.44 16.96 14.78 10.82 11.03 17.39 16.19 18.02
   [49] 13.04 20.32 13.98 16.00 16.74  8.73 19.76 15.95 15.03 10.35 22.22 10.84
   [61] 12.30 11.63 13.48 19.41 11.86 15.65 15.11 16.24 12.96  9.70 18.53 16.16
   [73] 18.83 17.95 30.00 12.23 25.10 20.97 13.55 29.68 12.27  9.49 15.91 13.24
   [85] 16.48  6.00 11.12 15.30 11.81 12.62  9.82 17.95 11.39 17.16 13.94 16.18
   [97] 13.38 14.86 11.93 19.59 15.16 16.29 14.47 15.48 14.35 13.80 18.41 15.13
  [109] 14.51 12.26 11.96 14.65 24.52 16.89 15.83 19.70 14.51 13.10 16.69 17.01
  [121] 15.30  9.04 14.87 13.97 19.03 19.76 14.63 10.08 13.30 15.56 19.86 17.24
  [133] 15.18 15.14 20.19 12.18  9.15 15.73 15.18 14.94  8.37 18.01  8.07 13.25
  [145] 22.28 12.08 15.65 15.29 19.00 15.66 14.87 21.51 21.10 14.69 12.42 22.14
  [157] 12.16  9.88 17.18 11.94 19.27 10.80 16.17 16.64 12.57 19.95 10.72 10.39
  [169] 17.10 12.29 11.87 18.44 17.08 10.61 18.55 15.32 13.92 10.15 12.11 17.56
  [181] 17.09 25.11 14.43 13.64 14.30 12.35 14.92 11.17 16.04 16.07 11.70 12.48
  [193] 16.15 10.52 15.07  8.25 16.11 16.57 19.78 19.73
  > # check if removing the names of the coefficients makes a difference
  > all.equal( cesData$y,
  +    cesCalc( xNames = xxNames, data = cesData, coef = unname( cesCoef ) ) )
  [1] TRUE
  > # check if permuting the coefficients makes a difference
  > all.equal( cesData$y,
  +    cesCalc( xNames = xxNames, data = cesData, coef = sample( cesCoef, 7 ) ) )
  [1] TRUE
  > 
  > # deterministic dependent variable with technological change
  > cesData$yTc <- cesCalc( xNames = xxNames, tName = "time", data = cesData, 
  +    coef = cesCoefTc )
  > print( cesData$yTc )
    [1]  14.8  12.2  11.1  15.6  16.5  16.1  22.8  10.9  30.2  12.2  18.6  15.8
   [13]  13.6  28.4  24.9  12.4  18.4  19.8  15.7  23.3  20.2  16.5  14.2  21.8
   [25]  14.9  21.0  17.3  26.4  27.1  32.5  26.2  16.0  29.8  35.9  30.1  14.8
   [37]  24.4  22.8  34.3  21.9  20.8  31.4  27.8  20.6  21.3  34.2  32.3  36.5
   [49]  26.8  42.4  29.6  34.4  36.5  19.3  44.4  36.4  34.8  24.3  53.0  26.3
   [61]  30.2  29.0  34.2  49.9  31.0  41.5  40.7  44.4  35.9  27.3  52.9  46.9
   [73]  55.4  53.7  91.0  37.7  78.5  66.6  43.6  97.1  40.7  32.0  54.4  46.0
   [85]  58.1  21.5  40.4  56.4  44.2  48.0  37.9  70.3  45.3  69.2  57.1  67.3
   [97]  56.5  63.7  51.9  86.5  67.9  74.1  66.8  72.6  68.3  66.7  90.3  75.3
  [109]  73.3  62.9  62.3  77.4 131.6  92.0  87.5 110.6  82.7  75.8  98.0 101.4
  [121]  92.6  55.5  92.7  88.4 122.3 128.9  96.9  67.7  90.7 107.8 139.6 123.0
  [133] 109.9 111.3 150.7  92.3  70.4 122.8 120.3 120.2  68.4 149.3  67.9 113.2
  [145] 193.2 106.3 139.8 138.7 174.9 146.4 141.0 207.1 206.3 145.8 125.1 226.4
  [157] 126.2 104.1 183.8 129.6 212.4 120.8 183.7 191.9 147.1 237.0 129.3 127.2
  [169] 212.6 155.1 152.1 239.8 225.4 142.1 252.3 211.4 195.1 144.3 174.9 257.3
  [181] 254.4 379.3 221.2 212.3 225.9 198.0 242.8 184.5 269.1 273.7 202.3 219.0
  [193] 287.8 190.2 276.7 153.7 304.8 318.1 385.5 390.3
  > all.equal( cesData$yTc, 
  +    cesData$y * exp( cesCoefTc[ "lambda" ] * c( 0:( nObs - 1 ) ) ) )
  [1] TRUE
  > # check if removing the names of the coefficients makes a difference
  > all.equal( cesData$yTc,
  +    cesCalc( xNames = xxNames, tName = "time", data = cesData, 
  +       coef = unname( cesCoefTc ) ) )
  [1] TRUE
  > # check if permuting the coefficients makes a difference
  > all.equal( cesData$yTc,
  +    cesCalc( xNames = xxNames, tName = "time", data = cesData, 
  +       coef = sample( cesCoefTc, 8 ) ) )
  [1] TRUE
  > 
  > 
  > # adding noise to the endogenous variable
  > cesData$y <- cesData$y + rnorm( nObs )
  > 
  > proc.time()
     user  system elapsed 
     2.00    0.21    2.21