This function takes the result of plot.phenology() and generates the information
to be used with fitRMU().
The value of density can be dnorm or dgamma. dnorm is better if ML results are used and
dgamma is for MCMC.
Here are some example of regular expressions (regex) in grep:
If format of timeseries is beachname-2005:
rookeries.names.grep="(.+)-.+"
years.grep=".+-(.+)$"
Examples:
gsub("(.+)-.+", "\\1", "beachname-2005"); gsub(".+-(.+)$", "\\1", "beachname-2005")
If format of timeseries is beachname-2005-2006:
rookeries.names.grep="(.+)-.+-.+"
years.grep=".+-([0-9][0-9][0-9][0-9])-.+$"
Examples:
gsub("(.+)-.+-.+", "\\1", "beachname-2005-2006");
gsub(".+-([0-9][0-9][0-9][0-9])-.+$", "\\1", "beachname-2005-2006")
If format of timeseries is beachname-20052006:
rookeries.names.grep="(.+)-.+"
years.grep=".+-([0-9][0-9][0-9][0-9])([0-9][0-9][0-9][0-9])$"
Examples:
gsub("(.+)-.+", "\\1", "beachname-20052006");
gsub(".+-([0-9][0-9][0-9][0-9])([0-9][0-9][0-9][0-9])$", "\\1", "beachname-20052006")
The return is a list with these elements:
RMU.data, years.byrow, colname.year, and RMU.names.
If density is a vector, the density used is linked to the rank of the timeseries in phenologyout.
phenology2fitRMU(
phenologyout = stop("A result obtained from summary(phenology)"),
col.mean = "with_obs_Mean_ML",
col.var = "with_obs_Var_ML",
rookeries.names.grep = "(.+)-.+",
years.grep = ".+-(.+)$",
limit.cv = +Inf,
limit.sd = +Inf,
density = "dgamma"
)
Return a list with elements ready to be used with fitRMU().
A result of plot.phenology() or summary()
Name of the column to be used as mean value. Can be a vector.
Name of the column to be used as variance value. Can be a vector.
The pattern to return the rookery name from names of timeseries.
The pattern to return the year from names of timeseries.
Remove data with higher coefficient of variation than the limit.
Remove data with higher standard deviation than the limit.
What density should be used. Can be dnorm or dgamma. Can be a vector.
Marc Girondot
phenology2fitRMU is used to prepare output of phenology to be used by fitRMU()
Other Phenology model:
AutoFitPhenology()
,
BE_to_LBLE()
,
Gratiot
,
LBLE_to_BE()
,
LBLE_to_L()
,
L_to_LBLE()
,
MarineTurtles_2002
,
MinBMinE_to_Min()
,
adapt_parameters()
,
add_SE()
,
add_phenology()
,
extract_result()
,
fit_phenology()
,
likelihood_phenology()
,
logLik.phenology()
,
map_Gratiot
,
map_phenology()
,
par_init()
,
phenology()
,
phenology_MHmcmc()
,
phenology_MHmcmc_p()
,
plot.phenology()
,
plot.phenologymap()
,
plot_delta()
,
plot_phi()
,
print.phenology()
,
print.phenologymap()
,
print.phenologyout()
,
remove_site()
,
result_Gratiot
,
result_Gratiot1
,
result_Gratiot2
,
result_Gratiot_Flat
,
result_Gratiot_mcmc
,
summary.phenology()
,
summary.phenologymap()
,
summary.phenologyout()
if (FALSE) {
library("phenology")
}
Run the code above in your browser using DataLab