hhh4contacts (version 0.13.1)

addGroups2WFUN: Group-Dependent Parametric Weights

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

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

Value

a list specifying group-dependent parametric weights for hhh4.

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.

Author

Sebastian Meyer

Examples

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

Run the code above in your browser using DataLab