plot.miHMM {momentuHMM} | R Documentation |
Plot miHMM
Description
For multiple imputation analyses, plot the pooled data stream densities over histograms of the data, probability distribution parameters and transition probabilities as functions of the covariates, and maps of the animals' tracks colored by the decoded states.
Usage
## S3 method for class 'miHMM'
plot(
x,
animals = NULL,
covs = NULL,
ask = TRUE,
breaks = "Sturges",
hist.ylim = NULL,
sepAnimals = FALSE,
sepStates = FALSE,
col = NULL,
cumul = TRUE,
plotTracks = TRUE,
plotCI = FALSE,
alpha = 0.95,
plotStationary = FALSE,
plotEllipse = TRUE,
...
)
Arguments
x |
Object |
animals |
Vector of indices or IDs of animals for which information will be plotted.
Default: |
covs |
Data frame consisting of a single row indicating the covariate values to be used in plots. If none are specified, the means of any covariates appearing in the model are used (unless covariate is a factor, in which case the first factor appearing in the data is used). |
ask |
If |
breaks |
Histogram parameter. See |
hist.ylim |
Parameter |
sepAnimals |
If |
sepStates |
If |
col |
Vector or colors for the states (one color per state). |
cumul |
If TRUE, the sum of weighted densities is plotted (default). |
plotTracks |
If TRUE, the Viterbi-decoded tracks are plotted (default). |
plotCI |
Logical indicating whether to include confidence intervals in natural parameter plots (default: FALSE) |
alpha |
Significance level of the confidence intervals (if |
plotStationary |
Logical indicating whether to plot the stationary state probabilities as a function of any covariates (default: FALSE) |
plotEllipse |
Logical indicating whether to plot error ellipses around imputed location means. Default: TRUE. |
... |
Additional arguments passed to |
Details
The state-dependent densities are weighted by the frequency of each state in the most
probable state sequence (decoded with the function viterbi
for each imputation). For example, if the
most probable state sequence indicates that one third of observations correspond to the first
state, and two thirds to the second state, the plots of the densities in the first state are
weighted by a factor 1/3, and in the second state by a factor 2/3.
Examples
## Not run:
# Extract data from miExample
obsData <- miExample$obsData
# error ellipse model
err.model <- list(x= ~ ln.sd.x - 1, y = ~ ln.sd.y - 1, rho = ~ error.corr)
# Fit crawl to obsData
crwOut <- crawlWrap(obsData,theta=c(4,0),fixPar=c(1,1,NA,NA),
err.model=err.model)
# Fit four imputations
bPar <- miExample$bPar
HMMfits <- MIfitHMM(crwOut,nSims=4,poolEstimates=FALSE,
nbStates=2,dist=list(step="gamma",angle="vm"),
Par0=bPar$Par,beta0=bPar$beta,
formula=~cov1+cos(cov2),
estAngleMean=list(angle=TRUE),
covNames=c("cov1","cov2"))
miHMM <- momentuHMM:::miHMM(list(miSum=MIpool(HMMfits),HMMfits=HMMfits))
plot(miHMM)
## End(Not run)