View source: R/calculate-sna-pars.R
This function uses a max. likelhood to separate the variance of true association indices and the sampling variance. It's described in "Precision and power in the analysis of social structure using associations" (Whitehead, 2008, Animal Behaviour) and "Whitehead, H. 2008. Analyzing Animal Societies: Quantitative Methods for Vertebrate Social Analysis. Chicago: University of Chicago Press."
1 2 3 4 5 6 7 | get_S_from_matrix(
i_j_sum,
i_j_together,
initial.values = c(0.5, 0.5),
lower = c(0.01, 0.01),
upper = c(1, 10)
)
|
i_j_sum |
Matrix with values i_j_sum[ij] used as denominator of the estimated association index (d in the Whitehead paper) |
i_j_together |
Matrix with values i_j_together[ij] number of observations of individuals i and j together (x in the Whitehead paper) |
initial.values |
Initial values for the parameters to be optimized over ('par' argument in 'optim“) |
lower |
lower bounds for parameters |
upper |
upper bounds for parameters |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.