This function takes a specification of parametric weights and returns a modified version with group-dependent parameters. Only single-parameter functions are currently supported.
addGroups2WFUN(WFUN, groups, initial = rep.int(WFUN$initial, nlevels(groups)))
a list specifying group-dependent parametric weights for hhh4.
hhh4
a list specification of parametric weights, e.g., as returned by the constructor functions W_powerlaw and W_np.
W_powerlaw
W_np
a vector of length nUnits determining to which group each unit belongs to. The supplied vector is converted to a factor using as.factor.
nUnits
as.factor
(named) vector of initial parameters.
Sebastian Meyer
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