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

View source: R/maxlikelihood_guilds.R

maxLikelihood.GuildsR Documentation

Maximization of the loglikelihood under the Guilds Model.

Description

This function computes the maximum likelihood estimates of the parameters of the guilds model.

Usage

maxLikelihood.Guilds(init_vals, model = "D0",
                     sadx, sady, verbose = FALSE)

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

## Not run: 
  J <- 10000

  theta <- 100
  alpha_x <- 0.1

  simul_data <- generate.Guilds(theta, alpha_x, alpha_x, J)

  #initial parameters for the D0 model c(theta,alpha)
  LL <- maxLikelihood.Guilds(init_vals = c(theta, alpha_x),
                             model = "D0",
                             sadx  = simul_data$guildX,
                             sady  = simul_data$guildY)

## End(Not run)

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