newborn_rule: Say what state a child is born into

View source: R/class_newborn_rule.R

newborn_ruleR Documentation

Say what state a child is born into

Description

Gives, for every state variable of the model, how a newborn's value is settled: fixed, drawn, or taken from the mother. For fertility().

Usage

newborn_rule(...)

from_mother()

Arguments

...

One named entry per state variable.

Details

Each state variable gets it's own argument of the same name:

a single value

something every child gets, e.g. parity = "0"

a named vector of probabilities

the value is drawn, e.g. sex = c(male = 0.515, female = 0.485). The probabilities must sum to one.

from_mother()

the child takes the mother's value, e.g. nat = from_mother(). The mother's value is the one she holds right after the birth transition.

Drawn variables are drawn independently of one another. When a probability must depend on an inherited value – e. g. a sex ratio that differs by nationality – use the table form, new_newborn_rule().

The rule is checked against the model when the subsystem is added. To pass, every state variable needs an entry, and every value must exist.

Value

An object of class micsim_newborn_spec.

See Also

fertility(), new_newborn_rule()

Examples

newborn_rule(sex = c(male = 0.515, female = 0.485),
             nat = from_mother(),
             parity = "0")


MicSim documentation built on Dec. 2, 2026, 1:09 a.m.