View source: R/weightmaxentropy.R
weightmaxentropy | R Documentation |
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.
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")
)
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 |
Search for the weights of the nests which maximize the entropy of nest temperatures distribution
A named vector of weights
Marc Girondot
## Not run:
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
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.