Learn R Programming

phenology (version 3.63)

plot.mcmcComposite: Plot the result of a MCMC search

Description

Plot the result of a MCMC search. The parameters to use can be called by: parameters="all" parameters=1:4 parameters=c("PAR1", "PAR2", "PAR5") parameters=c(TRUE, TRUE, FALSE, TRUE)

Usage

## S3 method for class 'mcmcComposite':
plot(x, ..., chain = 1, parameters = 1,
  legend = TRUE)

Arguments

x
A mcmcComposite object obtained after phenology_fonctionMCMC()
chain
The chain to use
parameters
Name of parameters or their number (see description)
legend
If FALSE, the legend is not shown
...
Graphical parameters to be send to hist()

Value

  • None

Details

plot.mcmcComposite plots the result of a MCMC search

Examples

Run this code
library(phenology)
# Read a file with data
data(Gratiot)
# Generate a formatted list named data_Gratiot
data_Gratiot<-add_phenology(Gratiot, name="Complete",
		reference=as.Date("2001-01-01"), format="%d/%m/%Y")
# Generate initial points for the optimisation
parg<-par_init(data_Gratiot, parametersfixed=NULL)
# Run the optimisation
result_Gratiot<-fit_phenology(data=data_Gratiot,
		parametersfit=parg, parametersfixed=NULL, trace=1)
data(result_Gratiot)
# Generate set of priors for Bayesian analysis
pmcmc <- phenology_MHmcmc_p(result_Gratiot, accept=TRUE)
result_Gratiot_mcmc <- phenology_MHmcmc(result = result_Gratiot, n.iter = 10000,
		parametersMCMC = pmcmc, n.chains = 1, n.adapt = 0, thin = 1, trace = FALSE)
data(result_Gratiot_mcmc)
plot(result_Gratiot_mcmc, parameters=3, xlim=c(230, 330))

Run the code above in your browser using DataLab