Description Usage Arguments Details Value Author(s) Examples
Generates posterior samples from a phenology model using an option of several different likelihoods and prior configurations.
1 2 3 |
formula |
a symbolic description of the regression model to be fit. The left hand size is the name of the Vegetation Index (VI) variable and the right and size is the name of the time variable. |
data |
an optional data frame containing the variables in the model. If not found in |
gamma |
a vector of length two that holds the VI variable's theoretical bounds. Lower and upper bounds are given in element 1 and 2, respectively. These must be finite values. |
family |
a quoted string that indicates which likelihood to use
for modeling the VI variable. Options are Beta, Normal, and
truncated Normal, specified using quoted argument values
|
starting |
a list with each tag corresponding to a parameter
name. Valid tags are |
tuning |
a list with each tag corresponding to a parameter
name. Valid tags are |
priors |
a list with tags |
n.samples |
the number of MCMC samples to collect. |
sub.sample |
an optional list that specifies the subset of MCMC samples should be returned. Valid tags are |
fitted |
if |
summary.only |
if |
verbose |
if |
n.report |
the interval to report Metropolis sampler acceptance and MCMC progress. |
... |
optional argument |
Selection of the likelihood via the family
argument should be
respective of possible VI value range. The Beta likelihood
assumes support for VI between 0 and 1. The Normal likelihood assumes support for VI on
the whole real line. The default for the truncated Normal likelihood is
support between 0 and 1; however, specifying the optional argument
t.normal.bounds
allows for user defined support bounds.
The default priors for the α's are:
alpha.1 ~ Unif(gamma[1], gamma[2]), | alpha.2 ~ Unif(0, gamma[2]-alpha.1), | alpha.3 ~ Unif(0, 1) |
alpha.4 ~ Unif(0, alpha.7), | alpha.5 ~ Unif(0, 0.001), | alpha.6 ~ Unif(0, 1) |
alpha.7 ~ Unif(0, 1) | ||
The hyperparameters of these prior distributions can be change using the
priors
argument.
An error will be thrown if an alpha starting value
provided in the starting
list is outside the default or supplied
priors. Note, alpha.2 and alpha.4 have
upper bounds determined by starting values of alpha.1
and alpha.7, respectively. As noted in the description
of the starting
argument, starting values will be automatically
generated if not provided. We strongly suggest that reasonable starting
values are provided or the MCMC sampler might not perform well.
The output is a list of class pheno
. List components include:
p.theta.samples |
is a |
MH.acceptance |
is a named vector with values giving the Metropolis
samplers |
p.fitted.samples |
if |
Andrew O. Finley finleya@msu.edu, Chad Babcock cbabcock@umn.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
##select a single pixel and a few years
df <- subset(aoi_hls, pixel == 1 & year %in% c(2017,2018,2019))
plot(df$doy, df$evi)
set.seed(1)
m.beta <- pheno(evi~doy, data=df, family="beta",
starting=list(alpha.1=0.1, alpha.2=0.5, alpha.3=0.25,
alpha.4=50, alpha.5=0.0001, alpha.6 = 0.25, alpha.7=200, sigma.sq=0.01),
tuning=list(alpha.1=0.001, alpha.2=0.01, alpha.3=0.001,
alpha.4=0.1, alpha.5=0.00005, alpha.6=0.001, alpha.7=0.5, sigma.sq=0.1),
n.samples=50000, n.report=25000,
priors=list(alpha=list(alpha.5=c(-1, 1)), sigma.sq.IG=c(2, 0.01)),
fitted = TRUE, sub.sample=list("start"=25000)
)
summary(m.beta)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.