maxLikelihood.Guilds.Conditional: Maximization of the loglikelihood under the Guilds Model,...

View source: R/maxlikelihood_guilds_conditional.R

maxLikelihood.Guilds.ConditionalR Documentation

Maximization of the loglikelihood under the Guilds Model, conditioned on guild size.

Description

This function computes the maximum likelihood estimates of the parameters of the guilds model, conditioned on guild size.

Usage

maxLikelihood.Guilds.Conditional(init_vals, model, sadx, sady, verbose = TRUE)

Arguments

init_vals

init_vals corresponds to a vector of parameter values in which to start the Maxmimum Likelihood algorithm, depending on the provided model:
- model: "D0" parameters = c(theta, alpha)
- model: "D1" parameters = c(theta, alpha X, alpha Y)

model

The chosen model to calculate the maximum likelihood for, please note that the vector of parameters should contain the corresponding parameters in the right order. The user can pick one of these models:
- "D0"
- "D1"

sadx

The Species Abundance Distribution of guild X

sady

The Species Abundance Distribution of guild Y

verbose

TRUE/FALSE flag, indicates whether intermediate output is shown on screen

Value

The output is a list containing the following:

par

a vector containing the parameter values at the maximum likelihood

value

the likelihood at the corresponding parameter values

counts

Number of function evaluations required

convergence

-2: invalid input
-1: number of maximum function evaluations exceeded
0: success: convergence
1: limit of machine precision reached

message

A character string giving a diagnostic message from the optimizer,

hessian

Hessian matrix (not implemented for this package)

Author(s)

Thijs Janzen

Examples

theta = 20
alpha = 0.1
initParams <- c(theta, alpha)
maxLikelihood.Guilds.Conditional(initParams,
                                 model = "D0",
                                 sadx  = 1:20,
                                 sady  = 1:20,
                                 verbose = TRUE)

GUILDS documentation built on Aug. 21, 2023, 5:10 p.m.