| KinPairSimulation-class {kindisperse} | R Documentation |
KinPairSimulation Class
Description
The class KinPairSimulation is a formal (S4) class for storing kinship and dispersal
distribution information derived from simulations in the kindisperse package.
It is derived from the KinPairData class.
The KinPairSimulation class is used to store information about the spatial distribution of kin dyads for use
in calculating axial sigmas of intergenerational dispersal as initially implemented in Jasper et al. 2019
(doi: 10.1111/1755-0998.13043).
Usage
## S4 method for signature 'KinPairSimulation'
show(object)
## S4 method for signature 'KinPairSimulation'
initialize(
.Object,
data = NULL,
kinship = NULL,
lifestage = NULL,
simtype = NULL,
kerneltype = NULL,
kernelshape = NULL,
posigma = NULL,
initsigma = NULL,
breedsigma = NULL,
gravsigma = NULL,
ovisigma = NULL,
customsigma = NULL,
cycle = NULL,
simdims = NULL,
call = NULL,
filtertype = NULL,
upper = NULL,
lower = NULL,
spacing = NULL,
samplenum = NULL,
sampledims = NULL,
model = NULL
)
Arguments
object |
object of class KinPairSimulation |
.Object |
object to be constructed into KinPairSimulation class |
data |
tbl_df. tibble of simulation values |
kinship |
character - one of PO, FS, HS, AV, HAV, GG, 1C, H1C, GAV, HGAV, 1C1, H1C1, GGG, 2C, and H2C. |
lifestage |
character - one of 'unknown', 'immature' or 'ovipositional' |
simtype |
character - simulation type |
kerneltype |
character. - 'Gaussian', 'Laplace' or 'vgamma' (variance-gamma) |
kernelshape |
numeric. - value of kernel shape of simulation (if using kernel with shape parameter e.g. vgamma) |
posigma |
numeric - overall value of dispersal sigma (for simple kernel) |
initsigma |
numeric. - value of pre-breeding dispersal sigma (for composite kernel) |
breedsigma |
numeric. - value of breeding dispersal sigma (for composite kernel) |
gravsigma |
numeric. - value of post-breeding dispersal sigma (for composite kernel) |
ovisigma |
numeric. - value of oviposition dispersal sigma (for composite kernel) |
customsigma |
numeric. - vector of named custom dispersal sigmas (for custom kernel) |
cycle |
integer - number of breeding cycles sampled individual has survived (for custom kernel) |
simdims |
numeric. - dimensions of sampling area (assumes one side of square) |
call |
call. Call to create object |
filtertype |
character. whether the initial sim has been further filtered |
upper |
numeric. - FILTER: upper threshold used |
lower |
numeric. - FILTER: lower threshold used |
spacing |
numeric. - FILTER: spacing used |
samplenum |
numeric. - FILTER: sample number used |
sampledims |
numeric. - FILTER: sample dimensions used |
model |
list - model information if custom simulation used to generate object |
KinPairSimulation |
an object of class KinPairSimulation |
Details
This class is essentially wrapped around the tbl_df class but with (a) expectations around certain columns
that must be present (id1, id2, kinship, & distance - three 'character' & one 'numeric' column), as
well as (b) additional attributes (kinship, lifestage, & cycle) characterizing the close-kin
dyads being stored.These attributes, as well as the embedded vector of distances, can be accessed with the methods
kinship, lifestage, breeding_cycle and distances.
In addition to the above attributes (derived from the KinPairData class), this class contains attributes
capturing the simulation type & parameters used to generate the final distribution of kin dyads.
Objects from this class are returned from the simulate_kindist_composite,
simulate_kindist_simple and simulate_kindist_custom functions
(& related), and are directly constructed with the namesake KinPairSimulation() function.
They can be passed to the sample_kindist function for filtering and subsampling, and to
axial functions (including axials_standard and axpermute_standard) for estimation of
axial dispersal.
Value
returns object of class KinPairSimulation
No return value, called for side effects
Returns an object of class KinPairSimulation
Methods (by generic)
-
show: print method -
initialize: initialisation method
Slots
kinshipcharacter - one of PO, FS, HS, AV, HAV, GG, 1C, H1C, GAV, HGAV, 1C1, H1C1, GGG, 2C, and H2C.
simtypecharacter. - one of 'simple', 'composite' or 'custom'
kerneltypecharacter. - 'Gaussian', 'Laplace' or 'vgamma' (variance-gamma)
posigmanumeric. - overall value of dispersal sigma (for simple kernel)
initsigmanumeric. - value of pre-breeding dispersal sigma (for composite kernel)
breedsigmanumeric. - value of breeding dispersal sigma (for composite kernel)
gravsigmanumeric. - value of post-breeding dispersal sigma (for composite kernel)
ovisigmanumeric. - value of oviposition dispersal sigma (for composite kernel)
customsigmanumeric - vector of named custom dispersal sigmas (for custom kernel)
simdimsnumeric. - dimensions of sampling area (assumes 1 side of square)
lifestagecharacter. - lifestage at sampling - either 'immature' or 'ovipositional'
cycleinteger - number of breeding cycles sampled individuals have survived (for custom kernel)
kernelshapenumeric. - shape parameter if vgamma kerneltype
callcall. - call to create initial simulation
tabtbl_df. - tibble of simulation values
filtertypecharacter. - whether the initial sim has been further filtered
uppernumeric. - FILTER: upper threshold used
lowernumeric. - FILTER: lower threshold used
spacingnumeric. - FILTER: spacing used
samplenumnumeric. - FILTER: sample number used
sampledimsnumeric. - FILTER: dimensions used
modelDispersalModel- model of dispersal used to create object (with custom type)
See Also
Other kdclasses:
DispersalModel-class,
KinPairData-class