simulation: True value for simulation

Description Usage Arguments Details See Also Examples

Description

spfrontier.true.value returns true parameter values for a simulation process

ezsimspfrontier tests estimators of a spatial stochastic frontier model with different parameters

Usage

1
2
3
4
5
6
7
8
9
spfrontier.true.value()

ezsimspfrontier(
  runs,
  params,
  inefficiency = "half-normal",
  logging = "info",
  control = list()
)

Arguments

runs

a number of simulated samples

params

a set with parameters to be used in simulation.

inefficiency

sets the distribution for inefficiency error component. Possible values are 'half-normal' (for half-normal distribution) and 'truncated' (for truncated normal distribution). By default set to 'half-normal'. See references for explanations

logging

an optional level of logging. Possible values are 'quiet','warn','info','debug'. By default set to quiet.

control

an optional list of control parameters for simulation process. Currently the procedure supports:
ignoreWy (TRUE/FALSE) - the spatial contiguity matrix for a dependent variable is not provided to spfrontier estimator (but used in DGP) ignoreWv (TRUE/FALSE) - the spatial contiguity matrix for a symmetric error term is not provided to spfrontier estimator (but used in DGP) ignoreWu (TRUE/FALSE) - the spatial contiguity matrix for a inefficiency error term is not provided to spfrontier estimator (but used in DGP) parallel (TRUE/FALSE) - whether to use parallel computer seed - a state for random number generation in R. If NULL (default), the initial state is random. See set.seed for details. auto_save - saves intermediate results to files. See ezsim for details.

Details

The spfrontier.true.value function should notbe used directly, it is exported for supporting ezsim

The ezsimspfrontier function executes multiple calls of the spfrontier estimator on a simulated data set, generated on the base of provided parameters. The resulting estimates can be analysed for biasedness, efficiency, etc.

See Also

ezsim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
params000 <- list(n=c(50, 100),beta0=5,
                 beta1=10,
                 beta2=1,
                 sigmaV=0.5, 
                 sigmaU=2.5)
ctrl <- list(seed=999, cores=1)
res000 <- ezsimspfrontier(2, params = params000,  
                 inefficiency = "half-normal",
                 logging = "info", 
                 control=ctrl)
summary(res000)

Example output

Loading required package: moments
Loading required package: tmvtnorm
Loading required package: mvtnorm
Loading required package: Matrix
Loading required package: stats4
Loading required package: gmm
Loading required package: sandwich
Loading required package: spdep
Loading required package: sp

Attaching package: 'spdep'

The following object is masked from 'package:moments':

    geary

Loading required package: ezsim
Thank you for using 'spfrontier'
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Predefined random seed: 999
[1] "Mark =  270"
Start [pid= 14445  n = 50 , run = 1 ]-------------------------> -2.17513749937688
Log-likelihood (true DGP) (pid=14445) = -85.2578166841441
INFO spfrontier (pid=14445) Estimator started
INFO spfrontier (pid=14445) Calculating initial values
INFO calculateInitialValues (pid=14445) Initial values method errorsarlm
INFO spfrontier (pid=14445) Initial values:
     Beta1      Beta2      Beta3     sigmaV     sigmaU 
 1.6063826 10.3300718  1.6485546  0.5442064  2.1509508 
Maximizing -- use negfn and neggr
INFO doTryCatch (pid=14445) Calculating numeric hessian, number of required function calls is  122  ...
INFO optimEstimator (pid=14445) Convergence is  achieved [ 0 ]
INFO optimEstimator (pid=14445) Log-Likelihood value =  -79.6629105970691
INFO spfrontier (pid=14445) Completed, status = 0
INFO spfrontier (pid=14445) Final estimates:
     Beta1      Beta2      Beta3     sigmaV     sigmaU 
4.12618894 9.76250494 1.79765749 0.01497415 2.30051601 
<-------------------------End pid= 14445
[1] "Mark =  92"
Start [pid= 14445  n = 50 , run = 2 ]-------------------------> -2.28343333422972
Log-likelihood (true DGP) (pid=14445) = -91.6509080951936
INFO spfrontier (pid=14445) Estimator started
INFO spfrontier (pid=14445) Calculating initial values
INFO calculateInitialValues (pid=14445) Initial values method errorsarlm
INFO spfrontier (pid=14445) Initial values:
     Beta1      Beta2      Beta3     sigmaV     sigmaU 
 1.5288196 10.6390541  1.2509212  0.8359614  2.0947003 
Maximizing -- use negfn and neggr
INFO doTryCatch (pid=14445) Calculating numeric hessian, number of required function calls is  122  ...
INFO optimEstimator (pid=14445) Convergence is  achieved [ 0 ]
INFO optimEstimator (pid=14445) Log-Likelihood value =  -89.0243943935539
INFO spfrontier (pid=14445) Completed, status = 0
INFO spfrontier (pid=14445) Final estimates:
     Beta1      Beta2      Beta3     sigmaV     sigmaU 
 3.8235779 10.5126460  1.1278940  0.5276554  2.3985818 
<-------------------------End pid= 14445
[1] "Mark =  48"
Start [pid= 14445  n = 100 , run = 1 ]-------------------------> -1.48369329781614
Log-likelihood (true DGP) (pid=14445) = -176.176710777771
INFO spfrontier (pid=14445) Estimator started
INFO spfrontier (pid=14445) Calculating initial values
INFO calculateInitialValues (pid=14445) Initial values method errorsarlm
INFO spfrontier (pid=14445) Initial values:
    Beta1     Beta2     Beta3    sigmaV    sigmaU 
3.3819685 9.9766585 0.7863375 0.5846982 2.3548633 
Maximizing -- use negfn and neggr
INFO doTryCatch (pid=14445) Calculating numeric hessian, number of required function calls is  122  ...
INFO optimEstimator (pid=14445) Convergence is  achieved [ 0 ]
INFO optimEstimator (pid=14445) Log-Likelihood value =  -175.449286035879
INFO spfrontier (pid=14445) Completed, status = 0
INFO spfrontier (pid=14445) Final estimates:
    Beta1     Beta2     Beta3    sigmaV    sigmaU 
5.2352487 9.8724719 0.9337123 0.4388289 2.4202759 
<-------------------------End pid= 14445
[1] "Mark =  35"
Start [pid= 14445  n = 100 , run = 2 ]-------------------------> 1.09278181091677
Log-likelihood (true DGP) (pid=14445) = -170.783923945398
INFO spfrontier (pid=14445) Estimator started
INFO spfrontier (pid=14445) Calculating initial values
INFO calculateInitialValues (pid=14445) Initial values method errorsarlm
INFO spfrontier (pid=14445) Initial values:
    Beta1     Beta2     Beta3    sigmaV    sigmaU 
3.1537994 9.9032982 1.2046796 0.3065791 2.2342946 
Maximizing -- use negfn and neggr
INFO doTryCatch (pid=14445) Calculating numeric hessian, number of required function calls is  122  ...
INFO optimEstimator (pid=14445) Convergence is  achieved [ 0 ]
INFO optimEstimator (pid=14445) Log-Likelihood value =  -168.399327906323
INFO spfrontier (pid=14445) Completed, status = 0
INFO spfrontier (pid=14445) Final estimates:
    Beta1     Beta2     Beta3    sigmaV    sigmaU 
4.9751404 9.9602544 1.0262273 0.5830375 2.0664144 
<-------------------------End pid= 14445
Executed in 3.24929308891296
   estimator   n beta0 beta1 beta2 sigmaV sigmaU    Mean   TV    Bias     SD
1    beta[0]  50     5    10     1    0.5    2.5  3.9749  5.0 -1.0251 0.2140
2    beta[0] 100     5    10     1    0.5    2.5  5.1052  5.0  0.1052 0.1839
3    beta[1]  50     5    10     1    0.5    2.5 10.1376 10.0  0.1376 0.5304
4    beta[1] 100     5    10     1    0.5    2.5  9.9164 10.0 -0.0836 0.0621
5    beta[2]  50     5    10     1    0.5    2.5  1.4628  1.0  0.4628 0.4736
6    beta[2] 100     5    10     1    0.5    2.5  0.9800  1.0 -0.0200 0.0654
7   sigma[v]  50     5    10     1    0.5    2.5  0.2713  0.5 -0.2287 0.3625
8   sigma[v] 100     5    10     1    0.5    2.5  0.5109  0.5  0.0109 0.1020
9   sigma[u]  50     5    10     1    0.5    2.5  2.3495  2.5 -0.1505 0.0693
10  sigma[u] 100     5    10     1    0.5    2.5  2.2433  2.5 -0.2567 0.2502
     rmse BiasPercentage
1  1.0472        -0.2050
2  0.2119         0.0210
3  0.5480         0.0138
4  0.1042        -0.0084
5  0.6622         0.4628
6  0.0684        -0.0200
7  0.4286        -0.4574
8  0.1026         0.0219
9  0.1657        -0.0602
10 0.3584        -0.1027

spfrontier documentation built on Dec. 19, 2019, 1:09 a.m.