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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/lnLCF.R

Description

Calculate the -log likelihood of data within a model.

Usage

1
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_f(), TableECFOCF(), fitCF(), logLik.ECFOCF(), plot.ECFOCF(), plot.TableECFOCF()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## 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["end"]])
fixed.parameters <- c(p=-Inf)

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

## End(Not run)

phenology documentation built on Oct. 23, 2020, 7:22 p.m.