Creates family households by matching adult household groups to sibling groups according to a parent-child age-gap distribution.
Arguments
- object
A
ReplicaStructureobject.- 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
ReplicaStructureobject 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:
Calculates representative ages for parent groups.
Determines the age of the oldest child in each sibling group.
Evaluates parent-child compatibility using the configured parent-child age-gap distribution.
Selects the most suitable parent group for each child group.
Creates family households.
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)
} # }
