compPlot {exdqlm} | R Documentation |
Plot a component of an exDQLM
Description
The function plots the dynamic MAP estimates and 95% credible intervals (CrIs) of a specified component of an exDQLM. Alternatively, if just.theta=TRUE
the MAP estimates and 95% credible intervals (CrIs) of a single element of the dynamic state vector are plotted.
Usage
compPlot(
y,
m1,
index,
add = FALSE,
col = "purple",
just.theta = FALSE,
cr.percent = 0.95
)
Arguments
y |
A univariate time-series. |
m1 |
An object of class " |
index |
Index of the component or element of the state vector to be plotted. |
add |
If |
col |
Color of dynamic component to be plotted. Default is |
just.theta |
If |
cr.percent |
Percentage used in the calculation of the credible intervals. |
Value
A list of the following is returned:
-
map.comp
- MAP estimate of the dynamic component (or element of the state vector). -
lb.comp
- Lower bound of the 95% CrIs of the dynamic component (or element of the state vector). -
ub.comp
- Upper bound of the 95% CrIs of the dynamic component (or element of the state vector).
Examples
y = scIVTmag[1:365]
trend.comp = polytrendMod(2,rep(0,2),10*diag(2))
seas.comp = seasMod(365,c(1,2,4),C0=10*diag(6))
model = combineMods(trend.comp,seas.comp)
M0 = exdqlmISVB(y,p0=0.85,model,df=c(0.98,1),dim.df = c(2,6),
gam.init=-3.5,sig.init=15,tol=0.05)
# plot first harmonic component
compPlot(y,M0,index=c(3,4),col="blue")