distr_var: Compute Variance

View source: R/main_distr.R

distr_varR Documentation

Compute Variance

Description

A function computing variance for a given distribution.

Usage

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.

Value

The variance.

See Also

distr()

Examples

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

# Variance for the multivariate normal distribution
distr_var(f = c(0, 0, 1, 1, 0.5), distr = "mvnorm")


gasmodel documentation built on Aug. 30, 2023, 1:09 a.m.