Skip to contents

Creates family households by matching adult household groups to sibling groups according to a parent-child age-gap distribution.

Usage

matchAdultsWithChildren(object, parents, children, id_offset)

Arguments

object

A ReplicaStructure object.

parents

List of adult groups generated by createSingles() or pair_partners.

children

List of sibling groups generated by group_children.

id_offset

Integer household identifier offset used when generating unique household IDs.

Value

A list containing:

object

Updated ReplicaStructure object containing newly created household records.

id_offset

Updated household identifier offset.

Details

This function is the final family-construction stage of the household-generation workflow and is typically called indirectly via createFromMembers.

The algorithm:

  1. Calculates representative ages for parent groups.

  2. Determines the age of the oldest child in each sibling group.

  3. Evaluates parent-child compatibility using the configured parent-child age-gap distribution.

  4. Selects the most suitable parent group for each child group.

  5. Creates family households.

  6. Creates childless households for any remaining unmatched adult groups.

Parent-child compatibility is determined using parent_child_age_distribution.

Child groups are processed in descending order of oldest child age.

Parent suitability is evaluated using score_suitability_by_age_disparity.

A minimum age difference between parents and children is enforced through the strict_lower_bound mechanism.

The oldest child in each sibling group is used when evaluating candidate parent groups.

Parent groups that cannot be matched to any child group are converted into childless households.

Household records are created using create_household_with_id.

Examples

if (FALSE) { # \dontrun{

result <- matchAdultsWithChildren(
  object = hh,
  parents = parents,
  children = children,
  id_offset = 1
)

names(result$object@households)

} # }