distr_score | R Documentation |
A function computing score or scaled score for a given distribution.
distr_score(y, f, distr, param = NULL, par_link = NULL, scaling = NULL)
y |
Observations. For an univariate distribution, a numeric vector. For a multivariate distribution, a numeric matrix with observations in rows or a numeric vector of a single observation. |
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. |
scaling |
An optional scaling function for the score. The supported scaling functions are the unit scaling ( |
The (scaled) score.
distr()
# Score for the negative binomial distribution
distr_score(y = c(1, 8, 5, 0, 0), f = c(0.5, 1.2), distr = "negbin")
# Score for the multivariate normal distribution
distr_score(y = rbind(c(0.5, 0.6), c(-2.3, -1.8), c(-0.2, 0.2)),
f = c(0, 0, 1, 1, 0.5), distr = "mvnorm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.