infer_gc — Infer group composition from social relationships
BOOLEAN
infer_gc
(
|
followdate, | |
chimpid); |
DATE
followdate
;
VARCHAR(5)
chimpid
;
BOOLEAN
infer_gc
(
|
followid); |
INT
followid
;The follow for which group composition should be inferred may be designated either by supplying the date and mother of the follow or by supplying the id of the follow.
infer_gc adds all
non-UNK social partners,
including baboons, and the mother's of young infant social
partners and the young infants of mother social partners, of
the focals of the specified follow to the group composition
tables. It does so by first ensuring that the focals are in
the group composition and then calling
add_social_partners() and
infants_in_gc() on all of the focals. Social
interaction with baboons is also checked for. See the
documentation of add_social_partners() for
further information.
This function does not remove any data from the group composition tables. If an existing group composition is to be re-inferred based on changes to database content the old group composition data must first be deleted.
It is an error to attempt to infer group composition
where group composition already exists -- as determined by
whether
FIELDFOLLOWS.GCStatus
is NULL
The group compositions, the RAW_GROUPS rows, are created at intervals of 15 minutes, starting at the time of the first behavioral observation, the first INTERVALS.Time value. Periods of no observation, periods during which there are no INTERVALS rows, lasting 15 minutes or longer cause a new set group compositions to start beginning at the time of the next observation, at the time of the next INTERVALS. Time value.
This function returns TRUE if the supplied follow
exists and group comp rows were created and FALSE
otherwise.
The following example demonstrates how to infer group
composition of all the follows which have none. All of the
INTERVALS rows of any follow having a group
composition have a GID value.
Those with no group composition have a NULL
GID value, and this is used to
identify all the follows with no group composition.
Example 6.2. Inferring the group composition of follows that have none
SELECT infer_gc(follows.followid)
FROM follows
WHERE NOT EXISTS (SELECT 1
FROM intervals
WHERE intervals.followid = follows.followid
AND intervals.gid IS NOT NULL);