Last data update: 2014.03.03

R: Likelihood of the Guilds sampling formula
logLikelihood.GuildsR Documentation

Likelihood of the Guilds sampling formula

Description

This function calculates the likelihood of the guilds model, provided abundance data and parameter values.

Usage

logLikelihood.Guilds(parameters, model, SADX, SADY, verbose = TRUE)

Arguments

parameters

parameters corresponds to a vector of parameter values 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 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

returns the LogLikelihood

Author(s)

Thijs Janzen

Examples

data(exampleData);
parametervals <- c(200, 0.005, 0.001) #theta = 200, alpha X = 0.005, alpha Y = 0.001
LL = logLikelihood.Guilds(parametervals, model="D1",
			  exampleData$guildX, exampleData$guildY, verbose=TRUE);

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GUILDS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GUILDS/logLikelihood.Guilds.Rd_%03d_medium.png", width=480, height=480)
> ### Name: logLikelihood.Guilds
> ### Title: Likelihood of the Guilds sampling formula
> ### Aliases: logLikelihood.Guilds
> 
> ### ** Examples
> 
> data(exampleData);
> parametervals <- c(200, 0.005, 0.001) #theta = 200, alpha X = 0.005, alpha Y = 0.001
> LL = logLikelihood.Guilds(parametervals, model="D1",
+ 			  exampleData$guildX, exampleData$guildY, verbose=TRUE);
Chosen model:  D1 
Now starting to calculate likelihood of: 
Theta X = 200  Theta Y = Theta X 	 Alpha X = 0.005  Alpha Y = 0.001 
200.000       200.0000       0.0050       0.0010        -390.917
Likelihood is  -390.9169 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>