Description Usage Arguments Value See Also Examples
Estimates parameters of predator preferences model and calculates LRT. Eaten and caught dataframes are indexed with rows across time points and columns of prey species.
1 2 |
eaten |
a dataframes of eatings preferences; TxS |
caught |
a dataframes of caught prey species; TxS |
hypotheses |
a 2-tuple specifying the null and alternative hypotheses, respectively |
alpha |
LRT level of significance |
em_maxiter |
maximum number of iterations allowed for EM algorithm |
A list of class 'predPref' with the following elements:
null: parameters as estimated under the specified null hypothesis.
alt: parameters as estimated under the specified alternative hypothesis.
loglikH0: the null hypothesis log-likelihood, with constants not accounted for.
loglikH1: the alternative hypothesis log-likelihood, with constants not accounted for.
J: a column vector of dimension T containing the number of predators in each time period.
I: a column vector of dimension T containing the number of traps in each time period.
LRT: the likelihood ratio test statistics.
hypotheses: a 2-tuple of the user specified hypotheses.
data.name: a character string giving the names of the data.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # set parameters
Predators <- Traps <- 100
PreySpecies <- 2
Times <- 5
g <- matrix(sqrt(2), nrow=Times, ncol=PreySpecies) # gamma
l <- matrix(seq(0.4,1.8,length.out=5)*sqrt(2), nrow=Times, ncol=PreySpecies) # ct
# fit model
## Not run:
fdata <- simPref(PreySpecies, Times, Predators, Traps, l, g, EM=FALSE)
predPref(fdata$eaten, fdata$caught, hypotheses=c('ct', 'cst'))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.