hrplot: Plot horizontal residual plots for a RMC model.

Description Usage Arguments Details Author(s) References See Also Examples

Description

Plot movement or a particular state's patch residuals for objects created by the estimation function RMC.mod.

Usage

1
hrplot( envel.obj, ylim, ...)

Arguments

envel.obj

a matrix of residuals and their upper and lower simulation limits. The easiest method to obtain this object is via a call to the diagnos.envel function. The object to be passed is an element of the resulting list. If the matrix has a column called "labels" then these are used as plot marks in the plot (useful for movement residuals).

ylim

a numeric vector of length 2 giving the minimum and maximum values for the y-axis. This parameter is very similar to that described in par but has slightly different implementation (very slight).

...

other graphical parameters to be passed to the plot function.

Details

This function is simple but care will need to be exercised in its use. See the example for best instruction and see Foster and Bravington (2009) for details about what the residuals are.

Author(s)

Scott D. Foster

References

Foster, S.D. and Bravington, M.V. (2009) Graphical Diagnostics for Markov Models for Categorical Data. Journal of Computational and Graphical Statistics, to appear.

See Also

RMC to estimate the Markov model, and diagnos and diagnos.envel to calculate residuals and simulation envelopes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#produces Figure 1 of Foster and Bravington (2009)
#fit RMC model to dataEG1
fm.est <- RMC.mod( states=dataEG1[,2], chain.id=dataEG1[,1], X=dataEG1[,3])
#calculate the simulation envelope (many fewer samples than Foster and Bravington (2009)
B<-50
temp.est <- diagnos.envel( obs.states=dataEG1[,2], chain.id=dataEG1[,1], X=dataEG1[,3,drop=FALSE], fit=fm.est, B=B)
#plot the patch residuals for the second state and the movement residuals
par(mfrow=c(1,2))
hrplot( temp.est[["patch"]][[2]], ylab="Patch Residuals - Normal Quantiles", xlab="Normal Quantiles", main="Stationary Data", pch=20)
hrplot( temp.est$movement, ylab="Movement Residuals - Normal Quantiles", xlab="Normal Quantiles", main="Stationary Data", pch=20)

RMC documentation built on May 30, 2017, 2:55 a.m.

Related to hrplot in RMC...