small_metrics {estimators}R Documentation

Small Sample Metrics

Description

This function performs Monte Carlo simulations to estimate the main metrics (bias, variance, and RMSE) characterizing the small sample behavior of an estimator. The function evaluates the metrics as a function of a single parameter, keeping the other ones constant. See Details.

Usage

small_metrics(
  D,
  prm,
  est = c("same", "me", "mle"),
  obs = c(20, 50, 100),
  sam = 10000,
  seed = 1,
  ...
)

Arguments

D

A subclass of Distribution. The distribution family of interest.

prm

A list containing three elements (name, pos, val). See Details.

est

character. The estimator of interest. Can be a vector.

obs

numeric. The size of each sample. Can be a vector.

sam

numeric. The number of Monte Carlo samples used to estimate the metrics.

seed

numeric. Passed to set.seed() for reproducibility.

...

extra arguments.

Details

The distribution D is used to specify an initial distribution. The list prm contains details concerning a single parameter that is allowed to change values. The quantity of interest is evaluated as a function of this parameter.

Specifically, prm includes three elements named "name", "pos", and "val". The first two elements determine the exact parameter that changes, while the third one is a numeric vector holding the values it takes. For example, in the case of the Multivariate Gamma distribution, D <- MGamma(shape = c(1, 2), scale = 3) and prm <- list(name = "shape", pos = 2, val = seq(1, 1.5, by = 0.1)) means that the evaluation will be performed for the MGamma distributions with shape parameters ⁠(1, 1)⁠, ⁠(1, 1.1)⁠, ..., ⁠(1, 1.5)⁠ and scale 3. Notice that the initial shape parameter 2 in D is not utilized in the function.

Value

For the small sample, a data.frame with columns named "Parameter", "Observations", "Estimator", "Metric", and "Value". For the large sample, a data.frame with columns "Row", "Col", "Parameter", "Estimator", and "Value".

See Also

plot_small_metrics large_metrics, plot_large_metrics

Examples


D <- Beta(shape1 = 1, shape2 = 2)

prm <- list(name = "shape1",
            pos = NULL,
            val = seq(0.5, 2, by = 0.5))

x <- small_metrics(D, prm,
                   est = c("mle", "me", "same"),
                   obs = c(20, 50),
                   sam = 1e2,
                   seed = 1)

plot_small_metrics(x)


[Package estimators version 0.8.5 Index]