distr_var function

Compute Variance

Compute Variance

A function computing variance for a given distribution.

distr_var(f, distr, param = NULL, par_link = NULL)

Arguments

  • f: Parameters. For the same parameters for all observations, a numeric vector. For individual parameters for each observation, a numeric matrix with rows corresponding to observations.
  • distr: A distribution.
  • param: A parametrization of the distribution.
  • par_link: An optional logical vector indicating whether the logarithmic/logistic link should be applied to restricted parameters in order to obtain unrestricted values. Defaults to keeping the original link for all parameters.

Returns

The variance.

Examples

# Variance for the negative binomial distribution distr_var(f = c(13.50, 0.03), distr = "negbin")

See Also

distr()

  • Maintainer: Vladimír Holý
  • License: GPL-3
  • Last published: 2024-02-02