Learn R Programming

embryogrowth (version 7.1)

info.nests: Calculte statistics about nests

Description

This function calculates many statistics about nests. The embryo.stages is a named vector with relative size as compared to final size at the beginning of the stage. Names are the stages. For example for SCL in Caretta caretta: embryo.stages=structure(c(8.4, 9.4, 13.6, 13.8, 18.9, 23.5, 32.2, 35.2, 35.5, 38.5)/39.33), .Names = c("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31")) indicates that the stages 21 begins at the relative size of 8.4/39.33. Series can be indicated as the name of the series, their numbers or series or sucession of TRUE or FALSE. "all" indicates that all series must be analyzed. The likelihood object is just the total likelihood of the data in the model. If one parameter is named "pipping_emergence" it is used as the number of days between pipping and emergence to calculate the 1/3 and 2/3 of incubation. The summary object is a data.frame composed of these elements:

  • TimeWeighted.temperature.mean Average temperature weigthed by the time at each temperature for all incubation

  • TimeWeighted.temperature.se Standard error for the average temperature weigthed by the time at each temperature for all incubation

  • MassWeighted.temperature.mean Average temperature weigthed by the growth of embryo for all incubation

  • MassWeighted.temperature.se Standard error for the average temperature weigthed by the growth of embryo for all incubation

  • TSP.TimeWeighted.temperature.mean Average temperature during the TSP weigthed by the time at each temperature

  • TSP.TimeWeighted.temperature.se Standard error for the average temperature during the TSP weigthed by the time at each temperature

  • TSP.MassWeighted.temperature.mean Average temperature during the TSP weigthed by the mass increase at each temperature

  • TSP.MassWeighted.temperature.se Standard error for the average temperature during the TSP weigthed by the mass increase at each temperature

  • TSP.STRNWeighted.temperature.mean Averaged temperature during the TSP weighted by sexualisation thermal reaction norm

  • TSP.STRNWeighted.temperature.se Standard error for temperature during the TSP weighted by sexualisation thermal reaction norm

  • TSP.MassWeighted.STRNWeighted.temperature.mean Averaged temperature during the TSP weighted by sexualisation thermal reaction norm and embryo growth

  • TSP.MassWeighted.STRNWeighted.temperature.se Standard error for temperature during the TSP weighted by sexualisation thermal reaction norm and embryo growth

  • TSP.length.mean Average length of the TSP

  • TSP.length.se Standard error for length of the TSP

  • TSP.begin.mean Average time of the beginning of the TSP

  • TSP.begin.se Standard error for the beginning of the TSP

  • TSP.end.mean Average time of the endd of the TSP

  • TSP.end.se Standard error for the end of the TSP

  • Incubation.length.mean Average number of days for the incubation length

  • Incubation.length.se Standard error for number of days for the incubation length

  • Middlethird.begin.mean Average day at which the middle third incubation begins

  • Middlethird.begin.se Standard error for day at which the middle third incubation begins

  • Middlethird.end.mean Average day at which the middle third incubation ends

  • Middlethird.end.se Standard error at which the middle third incubation ends

  • Middlethird.length.mean Average days for second third of incubation

  • Middlethird.length.se Standard error for second third of incubation

  • MiddleThird.TimeWeighted.temperature.mean Average temperature during the middle third of incubation

  • MiddleThird.TimeWeighted.temperature.se Standard error for the temperature during the middle third of incubation

  • MiddleThird.MassWeighted.temperature.mean Average temperature during the middle third of incubation weighted by embryo growth

  • MiddleThird.MassWeighted.temperature.se Standard error for temperature during the middle third of incubation weighted by embryo growth

The metric object is a list composed of data.frames which have the following attributes for each element of the list:

  • time.begin.tsp Average time at the beginning of TSP

  • time.end.tsp Average time at the end of TSP

  • time.begin.middlethird Average time at the beginning of the middle third of incubation

  • time.begin.middlethird Average time at the end of the middle third of incubation

  • time.begin.tsp.se Standard error for the time at the beginning of TSP

  • time.end.tsp.se Standard error for the time at the end of TSP

  • time.begin.middlethird.se Standard error for the time at the beginning of the middle third of incubation

  • time.end.middlethird.se Standard error for the time at the end of the middle third of incubation

  • stopattest NA if stopattest was false, TRUE if at least one incubation series was longer than hatchling size and FALSE at contrary

If you indicate new set of temperatures, you must probably also indicate new test values. Note: four species have predefined embryo stages. embryo.stages parameter can take the values:

  • Caretta caretta.SCL

  • Chelonia mydas.SCL

  • Emys orbicularis.SCL

  • Emys orbicularis.mass

  • Podocnemis expansa.SCL

But remember that mass is not the best proxy to describe the growth of an embryo because it can decrease if the subtrate becomes dry. The progress bar is based on both replicates and timeseries.

Usage

info.nests(x = NULL, parameters = NULL, NestsResult = NULL,
  resultmcmc = NULL, hessian = NULL, CI = NULL, fixed.parameters = NULL,
  SE = NULL, temperatures = NULL, derivate = NULL, test = NULL,
  stopattest = FALSE, M0 = NULL, series = "all", TSP.borders = NULL,
  embryo.stages = NULL, TSP.begin = 0, TSP.end = 0.5, replicate.CI = 1,
  weight = NULL, out = "likelihood", fill = NULL,
  SexualisationTRN = NULL, SexualisationTRN.mcmc = NULL,
  SexualisationTRN.CI = NULL, metric.end.incubation = NA,
  metabolic.heating = 0, temperature.heterogeneity = 0, progress = FALSE,
  warnings = TRUE, parallel = TRUE)

Arguments

x

A set of parameters to model the embryo growth thermal reaction norm or a NestsResult object.

parameters

A set of parameters to model the embryo growth thermal reaction norm. It will replace the parameters included in NestsResult (same as x).

NestsResult

A NestsResult object generated by searchR to model the embryo growth thermal reaction

resultmcmc

A mcmc result for embryo growth thermal reaction norm

hessian

An hessian matrix for embryo growth thermal reaction norm. It will replace the hessian matrix included in NestResult object.

CI

How to estimate CI for embryo growth thermal reaction norm; can be NULL, "SE", "MCMC", or "Hessian".

fixed.parameters

A set of fixed parameters to model the embryo growth thermal reaction norm. It will replace the fixed parameters included in NestsResult.

SE

Standard error for each parameter. It will replace the SE in NestsResult. Use SE=NA to remove SE from NestResult

temperatures

Timeseries of temperatures formatted using formatNests(). It will replace the one in NestsResult.

derivate

Function used to fit embryo growth: dydt.Gompertz, dydt.exponential or dydt.linear. It will replace the one in NestsResult.

test

Mean and SD of size of hatchlings. It will replace the one in NestsResult.

stopattest

TRUE or FALSE. If TRUE, the model stops when proxy of size reached the mean test size.

M0

Measure of hatchling size proxi at laying date. It will replace the one in NestsResult.

series

The name or number of the series to be estimated.

TSP.borders

The limits of TSP in stages. See embryo.stages parameter.

embryo.stages

The embryo stages. At least TSP.borders stages must be provided to estimate TSP borders. See note.

TSP.begin

Where TSP begin during the stage of beginning? In relative proportion of the stage.

TSP.end

Where TSP begin during the stage of ending? In relative proportion of the stage.

replicate.CI

Number of replicates to estimate CI. If <2, no CI is estimated.

weight

Weights of the different nests to estimate likelihood. It will replace the one in NestsResult.

out

Can take the values of "likelihood" or "metric" or "summary". "metric" and "summary" can be combined: c("metric", "summary")

fill

Number of minutes between two records. Create new one if they do not exist. NULL does not change the time of temperature recordings.

SexualisationTRN

A set of parameters used to model sexualisation thermal reaction norm during TSP or a result of STRN()

SexualisationTRN.mcmc

A mcmc object obtained from STRN_MHmcmc() to generate variability for sexualisation thermal reaction norm during TSP

SexualisationTRN.CI

How to estimate CI of sexualisation thermal reaction norm. Can be NULL, "SE", "MCMC", or "Hessian".

metric.end.incubation

The expected metric at the end of incubation. Used to calibrate TSP size. If NULL, take the maximum Mean of the test parameter. If NA, use the actual final size. Can be a vector and is recycled if necessary.

metabolic.heating

Degrees Celsius to be added at the end of incubation due to metabolic heating.

temperature.heterogeneity

SD of heterogeneity of temperatures. Can be 2 values, sd_low and sd_high and then HelpersMG::r2norm() is used.

progress

If FALSE, the progress bar is not shown (useful for using with sweave or knitr)

warnings

If FALSE, does not show warnings

parallel

If TRUE use parallel version for nests estimation

Value

Return or the total likelihood or a list with $metric and $summary depending on out parameter

Details

Calculate statistics about nests

Examples

Run this code
# NOT RUN {
library(embryogrowth)
data(resultNest_4p_SSM4p)
summary.nests <- info.nests(resultNest_4p_SSM4p, out="summary", replicate.CI=100, 
  resultmcmc=resultNest_mcmc_4p_SSM4p, 
  CI="MCMC", 
  progress=TRUE)
  # Result is in summary.nests$summary
infoall <- info.nests(resultNest_4p_SSM4p)
  # Result is a value
infoall.df <- info.nests(resultNest_4p_SSM4p, out="metric", replicate.CI=100, 
  resultmcmc=resultNest_mcmc_4p_SSM4p, 
  CI="MCMC", 
  progress=TRUE)
# Result is in summary.nests$metric
infoall.both <- info.nests(resultNest_4p_SSM4p, out=c("metric", "summary"), replicate.CI=100, 
  resultmcmc=resultNest_mcmc_4p_SSM4p, 
  CI="MCMC", 
  progress=TRUE)
# Results are in summary.nests$summary and in summary.nests$metric
infoall.both <- info.nests(resultNest_4p_SSM4p, out=c("metric", "summary"), replicate.CI=100, 
  CI="Hessian", 
  progress=TRUE)
infoall.both <- info.nests(resultNest_4p_SSM4p, out=c("metric", "summary"), replicate.CI=100, 
  CI="SE", 
  progress=TRUE)
# }

Run the code above in your browser using DataLab