Tagloss_mcmc_p: Generates set of parameters to be used with Tagloss_mcmc()

View source: R/Tagloss_mcmc_p.R

Tagloss_mcmc_pR Documentation

Generates set of parameters to be used with Tagloss_mcmc()

Description

Interactive (or not!) script used to generate set of parameters to be used with Tagloss_mcmc().

Usage

Tagloss_mcmc_p(
  result = stop("An output from Tagloss_fit() must be provided"),
  default.density = "dunif",
  accept = FALSE
)

Arguments

result

An object obtained after a Tagloss_fit() fit

default.density

The default density, "dnorm" or "dunif'

accept

If TRUE, does not wait for use interaction

Details

Tagloss_mcmc_p generates set of parameters to be used with Tagloss_mcmc()

Value

A matrix with the parameters

Author(s)

Marc Girondot

See Also

Other Model of Tag-loss: Tagloss_L(), Tagloss_LengthObs(), Tagloss_cumul(), Tagloss_daymax(), Tagloss_fit(), Tagloss_format(), Tagloss_mcmc(), Tagloss_model(), Tagloss_simulate(), logLik.Tagloss(), o_4p_p1p2, plot.Tagloss(), plot.TaglossData()

Examples

## Not run: 
library(phenology)
# Example
data_f_21 <- Tagloss_format(outLR, model="21")

# model fitted by Rivalan et al. 2005
par <- c(a0_2=-5.43E-2, a1_2=-103.52, a4_2=5.62E-4, 
         delta_1=3.2E-4)
pfixed <- c(a2_2=0, a3_2=0, a2_1=0, a3_1=0)
model_before <- "par['a0_1']=par['a0_2'];par['a1_1']=par['a1_2'];par['a4_1']=par['a4_2']"
o <- Tagloss_fit(data=data_f_21, fitted.parameters=par, fixed.parameters=pfixed, 
                 model_before=model_before)
pMCMC <- Tagloss_mcmc_p(o, accept=TRUE)
o_MCMC <- Tagloss_mcmc(data=data_f_21, parameters=pMCMC, fixed.parameters=pfixed, 
                 model_before=model_before, 
                 n.iter=10000, n.chains = 1, n.adapt = 100, thin=30)

## End(Not run)

phenology documentation built on Sept. 11, 2024, 6:07 p.m.