addGroups2WFUN: Group-Dependent Parametric Weights

Description Usage Arguments Value Author(s) Examples

View source: R/addGroups2WFUN.R

Description

This function takes a specification of parametric weights and returns a modified version with group-dependent parameters. Only single-parameter functions are currently supported.

Usage

1
addGroups2WFUN(WFUN, groups, initial = rep.int(WFUN$initial, nlevels(groups)))

Arguments

WFUN

a list specification of parametric weights, e.g., as returned by the constructor functions W_powerlaw and W_np.

groups

a vector of length nUnits determining to which group each unit belongs to. The supplied vector is converted to a factor using as.factor.

initial

(named) vector of initial parameters.

Value

a list specifying group-dependent parametric weights for hhh4.

Author(s)

Sebastian Meyer

Examples

1
2
3
4
data("measlesWeserEms")
WPLgroups <- addGroups2WFUN(
  W_powerlaw(maxlag = 5, normalize = FALSE, log = FALSE),
  groups = factor(sample(2, ncol(measlesWeserEms), replace = TRUE)))

hhh4contacts documentation built on July 4, 2017, 9:44 a.m.