Description Usage Arguments Author(s) References Examples
This makes a basic density plot given MCMC output from the main fitting functions of SCRbayes (e.g., SCRh.fn, SCRi.fn)
1 |
obj |
should be of class scrfit |
nx |
|
ny |
|
Xl |
|
Xu |
|
Yl |
|
Yu |
|
scalein |
|
scaleout |
|
ncolors |
|
opt.ss=FALSE |
If TRUE the density plot has support on the input state-space grid. If FALSE (default) the binning method is used. |
Andy Royle, aroyle@usgs.gov Joshua Goldberg, joshua.goldberg@umontana.edu
Modified from the SCR book Royle et al. (2013)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | data(wolverine)
## make the encounter data file (EDF)
EDF<-wolverine$wcaps
dimnames(EDF)<-list(NULL,c("session","individual","occasion","trapid"))
## grab the trap deployment file (TDF)
TDF<-wolverine$wtraps
## we will fit a model with sex-specific parameters, so grab the sex variable
wsex<-wolverine$wsex
## bundle these into an "scrdata" object along with the state-space grid
grid<-cbind(wolverine$grid2,rep(1,nrow(wolverine$grid2)))
wolv.scrdata<-scrData(TDF,EDF,grid,Xsex=wsex)
## now fit a model using the current development version of
## the fitting function
test<-SCRh.fn( wolv.scrdata,ni= 1200, burn=200, skip=2,nz=100,theta=1,
Msigma=1, Mb=0, Msex=1, Msexsigma=1,
coord.scale=5000, area.per.pixel=4, thinstatespace=4)
## make a density plot
SCRdensity(test, scalein=1, scaleout=1000000*100, nx=20,ny=20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.