Skip to contents

Draws samples from a known Beta-Danish or Exponentiated Danish distribution, refits each one, and reports the finite-sample behaviour of the maximum likelihood estimator.

Usage

bd_simulation_study(
  n = c(50, 100, 200),
  n_sim = 200,
  truth = c(a = 1.5, b = 3, c = 2, k = 0.5),
  submodel = FALSE,
  censor_rate = 0,
  n_starts = 3,
  level = 0.95,
  seed = NULL,
  quiet = FALSE
)

# S3 method for class 'bd_simulation'
print(x, digits = 4, ...)

# S3 method for class 'bd_simulation'
summary(object, ...)

Arguments

n

Vector of sample sizes.

n_sim

Number of replicates at each sample size.

truth

Named numeric vector of true parameters. Must contain `b`, `c` and `k`, and `a` unless `submodel` is `TRUE`.

submodel

Logical; fit the three-parameter ED submodel.

censor_rate

Approximate proportion of right-censored observations.

n_starts

Random starts per fit, on top of the deterministic grid.

level

Nominal coverage level.

seed

Optional integer seed.

quiet

Logical; suppress progress messages.

x

A `"bd_simulation"` object.

digits

Number of significant digits.

...

Ignored.

object

A `"bd_simulation"` object.

Value

An object of class `"bd_simulation"` with a `results` data frame, one row per sample size and parameter.

Details

Read `se_ratio` and `coverage` together. A ratio near one with coverage near the nominal level means the asymptotic standard errors are trustworthy at that sample size. A ratio well below one means they are optimistic, and coverage will fall short accordingly.

`n_fail` counts replicates where no admissible optimum was found. A high rate is not a nuisance to be suppressed: it says the parameter region being studied is hard to estimate at that sample size.

See also

[bd_simulation_cure()], [bd_simulation_competing()]

Examples

# \donttest{
# Deliberately tiny so the example runs in seconds. A real study would use
# n_sim in the hundreds; see the vignette.
s <- bd_simulation_study(n = 60, n_sim = 3,
                         truth = c(b = 3, c = 2, k = 0.5),
                         submodel = TRUE, n_starts = 1,
                         seed = 1, quiet = TRUE)
s
#> 
#> Beta-Danish simulation study: univariate
#>   replicates: 3   sample sizes: 60
#>   nominal coverage: 95%
#> 
#>   n parameter truth   mean   bias   rmse se_ratio coverage n_fail
#>  60         b   3.0 3.5154 0.5154 0.9646    1.624        1      0
#>  60         c   2.0 2.8881 0.8881 1.0222    2.215        1      0
#>  60         k   0.5 0.7635 0.2635 0.3869    2.000        1      0
#> 
# }