Learn R Programming

ezsim (version 0.5.5)

test.ezsim: Perform a Test for an ezsim Object

Description

For each set of parameters, the simulation is ran once to obtain the value of estimator and true value to make sure everything in ezsim is properly defined. The test results will be shown in the console. The test will be ran automatically when you create an ezsim object.

Usage

"test"(x, return_name = TRUE, print_result = FALSE, ...)

Arguments

x
An ezsim Object
return_name
Whehter to return the name of estimator
print_result
Whehter to print the return
...
unused

Value

Optional: names of estimator.

See Also

ezsim

Examples

Run this code
## Not run: 
# ezsim_basic<-ezsim(
#     m             = 100,
#     run           = FALSE,
#     run_test      = FALSE,
#     display_name  = c(mean_hat="hat(mu)",sd_mean_hat="hat(sigma[hat(mu)])"),
#     parameter_def = createParDef(list(n=seq(20,80,20),mu=c(0,2),sigma=c(1,3,5))),
#     dgp           = function() rnorm(n,mu,sigma),
#     estimator     = function(x) c(mean_hat = mean(x),
#                                  sd_mean_hat=sd(x)/sqrt(length(x)-1)),
#     true_value    = function() c(mu, sigma / sqrt(n-1))
# )
# 
# test(ezsim_basic,print_result=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab