fitCF_MHmcmc_p: Generate set of parameters to be used with fitCF_MHmcmc()

View source: R/fitCF_MHmcmc_p.R

fitCF_MHmcmc_pR Documentation

Generate set of parameters to be used with fitCF_MHmcmc()

Description

Interactive script used to generate set of parameters to be used with fitCF_MHmcmc().

Usage

fitCF_MHmcmc_p(
  result = stop("An output from fitCF() must be provided"),
  density = "dunif",
  accept = FALSE
)

Arguments

result

An object obtained after a fitCF() fit

density

Preset of density; can be dnorm or dunif

accept

If TRUE, does not wait for user interaction

Details

fitCF_MHmcmc_p generates set of parameters to be used with fitCF_MHmcmc()

Value

A matrix with the parameters

Author(s)

Marc Girondot

See Also

Other Model of Clutch Frequency: ECFOCF_f(), ECFOCF_full(), TableECFOCF(), fitCF(), fitCF_MHmcmc(), generateCF(), lnLCF(), logLik.ECFOCF(), plot.ECFOCF(), plot.TableECFOCF()

Examples

## Not run: 
library("phenology")
data(MarineTurtles_2002)
ECFOCF_2002 <- TableECFOCF(MarineTurtles_2002)

# Paraetric model for clutch frequency
o_mu1p1_CFp <- fitCF(x = c(mu = 2.1653229641404539, 
                 sd = 1.1465246643327098, 
                 p = 0.25785366120357966), 
                 fixed.parameters=NULL, 
                 data=ECFOCF_2002, hessian = TRUE)
                           
pMCMC <- fitCF_MHmcmc_p(result=o_mu1p1_CFp, accept=TRUE)
fitCF_MCMC <- fitCF_MHmcmc(result = o_mu1p1_CFp, n.iter = 10000, 
                           parametersMCMC = pMCMC, n.chains = 1, n.adapt = 0, 
                           thin = 1, trace = FALSE)
plot(fitCF_MCMC, parameters="mu")
plot(fitCF_MCMC, parameters="sd")
plot(fitCF_MCMC, parameters="p", xlim=c(0, 0.5), breaks=seq(from=0, to=0.5, by=0.05))
plot(fitCF_MCMC, parameters="p", transform = invlogit, xlim=c(0, 1), 
     breaks=c(seq(from=0, to=1, by=0.05)))

## End(Not run)

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