Forms couples from eligible adults according to household structure definitions, gender distributions and age-gap distributions.
Value
A list of couples.
Each couple is represented as:
The updated ReplicaStructure object is attached as:
attr(result, "object")Details
This function is one of the core household-generation
algorithms in replica and is typically called
indirectly via createFromMembers.
Couples are created by:
Determining the required number of couples.
Allocating couples according to the specified gender-distribution constraints.
Allocating partner age gaps according to the specified age-gap distribution.
Selecting a primary partner.
Selecting the best available secondary partner.
Recording assigned agents in
sampled_agents.
Couple composition is controlled by:
couple_gender_distributioncouple_age_distribution
Age-gap specifications are interpreted using
parse_age_gap.
Candidate partners are selected using:
Agents assigned to a couple are added to the
sampled_agents slot to prevent subsequent
reassignment.
Examples
if (FALSE) { # \dontrun{
hh <- ReplicaStructure(
"CoupleHousehold"
)
hh <- renew(
hh,
household_position = "Parent",
position_identifier = "adult",
amount = 2,
backup_position_identifiers = character()
)
hh@couple_gender_distribution <- c(
"Male|Female" = 1
)
hh@couple_age_distribution <- c(
"-5-5" = 1
)
couples <- pair_partners(
hh,
rep(TRUE, nrow(pop))
)
} # }
