Learn R Programming

embryogrowth (version 9.5)

weightmaxentropy: Search for the weights of the nests which maximize the entropy of nest temperatures distribution

Description

Search for the weights of the nests which maximize the entropy of nest temperatures distribution. Entropy is measured by Shanon index.
Entropy method must be entropy.empirical because it is the only method insensitive to scaling.
If no weight is given, the initial weight is uniformly distributed.
Use control_optim=list(trace=0) for not show progress of search report.

Usage

weightmaxentropy(
  temperatures = stop("Temperature data must be provided !"),
  weight = NULL,
  entropy.method = entropy::entropy.empirical,
  plot = TRUE,
  control_optim = list(trace = 0, maxit = 500),
  control_plot = NULL,
  control_entropy = NULL,
  col = c("black", "red")
)

Value

A named vector of weights

Arguments

temperatures

Timeseries of temperatures formated using FormatNests()

weight

A named vector of the initial weight search for each nest for likelihood estimation

entropy.method

Entropy function, for example entropy::entropy.empirical. See package entropy for description

plot

Do the plot of temperatures before and after weight must be shown ? TRUE or FALSE

control_optim

A list with control paramaters for optim function

control_plot

A list with control paramaters for plot function

control_entropy

A list with control paramaters for entropy function

col

Colors for unweighted and weighted distributions

Author

Marc Girondot

Details

Search for the weights of the nests which maximize the entropy of nest temperatures distribution

Examples

Run this code
if (FALSE) {
library(embryogrowth)
data(nest)
formated <- FormatNests(nest)
w <- weightmaxentropy(formated, control_plot=list(xlim=c(20,36)))
x <- structure(c(120.940334922916, 467.467455887442,  
	306.176613681557, 117.857995419495),  
	.Names = c("DHA", "DHH", "T12H", "Rho25"))
# pfixed <- c(K=82.33) or rK=82.33/39.33
pfixed <- c(rK=2.093313)
# K or rK are not used for dydt.linear or dydt.exponential
resultNest_4p_weight <- searchR(parameters=x,  
	fixed.parameters=pfixed, temperatures=formated,  
	integral=integral.Gompertz, M0=1.7, hatchling.metric=c(Mean=39.33, SD=1.92),  
	method = "BFGS", weight=w)
data(resultNest_4p_weight)
plotR(resultNest_4p_weight, ylim=c(0,0.50), xlim=c(15, 35))
# Standard error of parameters can use the GRTRN_MHmcmc() function
}

Run the code above in your browser using DataLab