lnLCF: Calculate the -log likelihood of data within a model.

View source: R/lnLCF.R

lnLCFR Documentation

Calculate the -log likelihood of data within a model.

Description

Calculate the -log likelihood of data within a model.

Usage

lnLCF(x, data, fixed.parameters = NULL, parallel = TRUE, verbose = FALSE)

Arguments

x

A named vector of parameters (mu, sd, mu_season, sd_season, a, p and OTN).

data

CMR database formated using TableECFOCF().

fixed.parameters

Parameters that are fixed.

parallel

If TRUE, parallel computing in ECFOCF_f is used.

verbose

if TRUE, show the parameters.

Details

lnLCF calculate the -log likelihood of data within a model.

Value

Return the -log likelihood of data within a model.

Author(s)

Marc Girondot

See Also

Other Model of Clutch Frequency: ECFOCF_full(), ECFOCF_f(), TableECFOCF(), fitCF_MHmcmc_p(), fitCF_MHmcmc(), fitCF(), generateCF(), logLik.ECFOCF(), plot.ECFOCF(), plot.TableECFOCF()

Examples

## Not run: 
library(phenology)
# Example
ECFOCF_2002 <- TableECFOCF(MarineTurtles_2002)
lnLCF(x=c(mu=4.71768454279272, 
                         sd=1.075711951667, 
                         p=-1.79746277312909), 
                 data=ECFOCF_2002)


ECFOCF_2002 <- TableECFOCF(MarineTurtles_2002, date0=as.Date("2002-01-01"))
fp <- rep(0, dim(ECFOCF_2002)[3])
names(fp) <- paste0("p.", formatC(1:(dim(ECFOCF_2002)[3]), width=2, flag="0"))
par <- c(mu1 = 0.6404831115214353, 
         sd1 = 0.69362774786433479, 
         mu2 = 5.6404831115214353, 
         sd2 = 5.69362774786433479, 
         mu_season = 12.6404831115214353, 
         sd_season = 1.69362774786433479, 
         OTN=1)
par <- c(par, fp[attributes(ECFOCF_2002)$table["begin"]:attributes(ECFOCF_2002)$table["final"]])
fixed.parameters <- c(p=-Inf)

lnLCF(x=par, data=ECFOCF_2002, fixed.parameters=fixed.parameters)

## End(Not run)


phenology documentation built on Oct. 16, 2023, 9:06 a.m.