## Not run:
# library(embryogrowth)
# data(nest)
# formated <- FormatNests(nest)
# # The initial parameters value can be:
# # "T12H", "DHA", "DHH", "Rho25"
# # Or
# # "T12L", "DT", "DHA", "DHH", "DHL", "Rho25"
# x <- structure(c(118.768297442004, 475.750095909406, 306.243694918151,
# 116.055824800264), .Names = c("DHA", "DHH", "T12H", "Rho25"))
# # pfixed <- c(K=82.33) or rK=82.33/39.33
# pfixed <- c(rK=2.093313)
# resultNest_4p <- searchR(parameters=x, fixed.parameters=pfixed,
# temperatures=formated, derivate=dydt.Gompertz, M0=1.7,
# test=c(Mean=39.33, SD=1.92))
# data(resultNest_4p)
# pMCMC <- TRN_MHmcmc_p(resultNest_4p, accept=TRUE)
# # Take care, it can be very long, sometimes several days
# result_mcmc_4p_80 <- GRTRN_MHmcmc(result=resultNest_4p,
# parametersMCMC=pMCMC, n.iter=10000, n.chains = 1, n.adapt = 0,
# thin=1, trace=TRUE)
# data(result_mcmc_4p)
# plotR(result=resultNest_4p, SE=result_mcmc_4p$TimeSeriesSE,
# ylim=c(0,0.3))
# x <- structure(c(115.758929130522, 428.649022170996, 503.687251738993,
# 12.2621455821612, 306.308841227278, 116.35048615105), .Names = c("DHA",
# "DHH", "DHL", "DT", "T12L", "Rho25"))
# plotR(parameters=x, xlim=c(20,35))
# pfixed <- c(rK=2.093313)
# resultNest_6p <- searchR(parameters=x, fixed.parameters=pfixed,
# temperatures=formated, derivate=dydt.Gompertz, M0=1.7,
# test=c(Mean=39.33, SD=1.92))
# data(resultNest_6p)
# plotR(list(resultNest_4p, resultNest_6p),
# col=c("black", "red"), legend=c("4 parameters", "6 parameters"))
# ##########################################
# # new formulation of parameters
# data(resultNest_newp)
# plotR(resultNest_newp)
# ## End(Not run)
Run the code above in your browser using DataLab