Skip to content

Commit

Permalink
Update docs and clean up pkgdown site
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkellner committed Feb 9, 2025
1 parent b022131 commit d652d38
Show file tree
Hide file tree
Showing 22 changed files with 155 additions and 66 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ README.Rmd
^vignettes/colext.Rmd.orig
^.*\.Rproj$
^\.Rproj\.user$
^pkgdown$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: unmarked
Version: 1.5.0
Date: 2025-02-07
Date: 2025-02-09
Type: Package
Title: Models for Data from Unmarked Animals
Authors@R: c(
Expand Down
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Improve and standardize documentation for these methods
* More tests for these methods
* Use reformulas package instead of lme4 for random effects formula handling
* Deprecate imputeMissing function
* Fix likelihood bug in goccu when primary periods were missing
* Fix bug in occuMulti getP method

Expand Down
64 changes: 35 additions & 29 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@ reference:
- occu
- goccu
- colext
- occuFP
- occuComm
- occuMS
- occuMulti
- occuPEN
- occuFP
- occuTTD
- occuCOP
- title: Abundance models
contents:
- occuRN
- pcount
- distsamp
- IDS
- multinomPois
- pcount.spHDS
- gpcount
- gmultmix
- gdistsamp
Expand All @@ -37,27 +36,37 @@ reference:
- distsampOpen
- multmixOpen
- nmixTTD
- title: Model diagnostics
- IDS
- pcount.spHDS
- title: Study design
contents:
- fitted,unmarkedFit-method
- parboot
- nonparboot,unmarkedFit-method
- residuals,unmarkedFit-method
- simulate,unmarkedFrame-method
- powerAnalysis
- simulate,unmarkedFit-method
- vif
- title: Model selection
- title: Model criticism
contents:
- vif
- fitted,unmarkedFit-method
- residuals,unmarkedFit-method
- fitList
- modSel
- crossVal,unmarkedFit-method
- modSel
- simulate,unmarkedFit-method
- parboot
- nonparboot,unmarkedFit-method
- title: Model results
contents:
- predict,unmarkedFit-method
- ranef
- bup
- posteriorSamples,unmarkedRanef-method
- plotEffects
- randomTerms
- sigma
- title: Organize data
contents:
- unmarkedFrame
- unmarkedFrame-class
- unmarkedMultFrame
- unmarkedFrameDS
- unmarkedFrameOccu
- unmarkedFrameOccuComm
- unmarkedFrameOccuFP
- unmarkedFrameOccuMulti
- unmarkedFramePCount
Expand All @@ -74,19 +83,7 @@ reference:
- unmarkedFrameGOccu
- unmarkedFrameMMO
- unmarkedFrameDSO
- title: Model results
contents:
- coef,unmarkedFit-method
- predict,unmarkedFit-method
- linearComb
- backTransform
- ranef
- bup
- posteriorSamples,unmarkedRanef-method
- projected
- plotEffects
- randomTerms
- sigma
- unmarkedMultFrame
- title: Datasets
contents:
- birds
Expand All @@ -105,6 +102,9 @@ reference:
- Switzerland
- title: internal
contents:
- unmarkedFrame
- linearComb
- backTransform
- SE-methods
- SSE
- computeMPLElambda
Expand All @@ -121,7 +121,7 @@ reference:
- occuPEN_CV
- optimizePenalty-methods
- getFP-methods
- getP-methods
- getP
- imputeMissing
- lambda2psi
- makePiFuns
Expand All @@ -137,3 +137,9 @@ reference:
- sight2perpdist
- predict,unmarkedFitOccuMulti-method
- predict,unmarkedFitOccuMS-method
- unmarkedFit-class
- unmarkedFrame-class
- coef-methods
- richness
- unmarkedModSel-class
- unmarkedRanef-class
31 changes: 31 additions & 0 deletions man/bup.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
\name{bup}
\alias{bup}
\alias{bup,unmarkedRanef-method}

\title{Extract Best Unbiased Predictors (BUPs) of latent variables from \code{ranef} output}

\description{
Extract Best Unbiased Predictors (BUPs) of latent variables such as
occupancy or abundance from a \code{unmarkedRanef} object produced by the
\code{ranef} function. Either the posterior mean or median can be requested.
}

\usage{
\S4method{bup}{unmarkedRanef}(object, stat = c("mean", "mode"), ...)
}

\arguments{
\item{object}{A \code{unmarkedRanef} object, the output of a call to \code{ranef}.}
\item{stat}{The statistic to calculate from the posterior, either mean or mode.}
\item{...}{Other arguments, currently ignored}
}

\value{
A vector of length M for single-season models, where M is the number of sites.
A matrix MxT for multi-season models, where T is the number of primary periods.
Values in the vector or matrix are the BUPs (occupancy or abundance states).
}

\seealso{
\code{\link{ranef}}, \code{\link{unmarkedRanef-class}}
}
2 changes: 1 addition & 1 deletion man/crossVal.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
\alias{show,unmarkedCrossVal-method}
\alias{show,unmarkedCrossValList-method}

\title{Cross-validation methods for fitted unmarked models and fit lists}
\title{Cross-validation methods for fitted \code{unmarked} models and fit lists}

\description{Test predictive accuracy of fitted models using several
cross-validation approaches. The dataset is divided by site only into folds or
Expand Down
2 changes: 1 addition & 1 deletion man/fitList.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\name{fitList}
\alias{fitList}
\title{constructor of unmarkedFitList objects}
\title{Create a list of fitted \code{unmarked} models}
\usage{fitList(..., fits, autoNames=c("object", "formula"))}
\description{Organize models for model selection or model-averaged prediction.}
\arguments{
Expand Down
2 changes: 1 addition & 1 deletion man/goccu.Rd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\name{goccu}
\alias{goccu}
\title{
Fit multi-scale occupancy models
Fit the multi-scale occupancy model of Nichols et al. (2008)
}
\description{
Fit multi-scale occupancy models as described in Nichols et al. (2008) to
Expand Down
24 changes: 8 additions & 16 deletions man/modSel.Rd
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
\name{modSel}
\title{Model selection results from an unmarkedFitList}
\title{Model selection on a list of \code{unmarked} model fits}
\description{Model selection results from an unmarkedFitList}
\alias{modSel}
\alias{modSel-methods}
\alias{unmarkedModSel-class}
\alias{show,unmarkedModSel-method}
\alias{summary,unmarkedModSel-method}
\alias{coef,unmarkedModSel-method}
\alias{SE,unmarkedModSel-method}

\arguments{
\item{object}{an object of class "unmarkedFitList" created by the function
\code{\link{fitList}}.}
Expand All @@ -17,20 +12,17 @@
}
}
\value{
A S4 object with the following slots
\item{Full}{data.frame with formula, estimates, standard errors and model
selection information. Converge is optim convergence code. CondNum is
model condition number. n is the number of sites. delta is delta AIC.
cumltvWt is cumulative AIC weight.
Rsq is Nagelkerke's (1991) R-squared index, which is only returned when
the nullmod argument is specified. }
\item{Names}{matrix referencing column names of estimates (row 1) and
standard errors (row 2).}
An object of class \code{unmarkedModSel}.
}
\note{Two requirements exist to conduct AIC-based model-selection and model-averaging in unmarked. First, the data objects (ie, unmarkedFrames) must be identical among fitted models. Second, the response matrix must be identical among fitted models after missing values have been removed. This means that if a response value was removed in one model due to missingness, it needs to be removed from all models.
}
\seealso{\code{\link{unmarkedModSel-class}}}
\references{Nagelkerke, N.J.D. (2004) A Note on a General Definition of the
Coefficient of Determination. \emph{Biometrika} 78, pp. 691-692.}
\author{Richard Chandler \email{[email protected]}}
\examples{
data(linetran)
Expand Down
2 changes: 1 addition & 1 deletion man/nmixTTD.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\name{nmixTTD}
\alias{nmixTTD}
\title{Fit N-mixture Time-to-detection Models}
\title{Fit the N-mixture Time-to-detection Model of Strebel et al. (2021)}

\usage{nmixTTD(stateformula= ~1, detformula = ~1, data, K=100,
mixture = c("P","NB"), ttdDist = c("exp", "weibull"), starts, method="BFGS",
Expand Down
2 changes: 1 addition & 1 deletion man/occuCOP.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

\encoding{UTF-8}

\title{Fit the occupancy model using count dta}
\title{Fit the occupancy model using count data}

\usage{
occuCOP(data,
Expand Down
2 changes: 1 addition & 1 deletion man/occuComm.Rd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\name{occuComm}
\alias{occuComm}

\title{Fit a community occupancy model}
\title{Fit a community occupancy model with species-level random effects}

\usage{
occuComm(formula, data, starts, method="BFGS", se=TRUE, ...)
Expand Down
2 changes: 1 addition & 1 deletion man/occuMS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

\alias{occuMS}

\title{Fit Single-Season and Dynamic Multi-State Occupancy Models}
\title{Fit Multi-State Occupancy Models (Nichols et al. 2007, MacKenzie et al. 2009)}

\usage{occuMS(detformulas, psiformulas, phiformulas=NULL, data,
parameterization=c("multinomial","condbinom"),
Expand Down
2 changes: 1 addition & 1 deletion man/occuMulti.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

\alias{occuMulti}

\title{Fit the Rota et al. (2016) Multi-species Occupancy Model}
\title{Fit the multi-species occupancy model of Rota et al. (2016)}

\usage{occuMulti(detformulas, stateformulas, data, maxOrder, penalty=0, boot=30,
starts, method="BFGS", se=TRUE, engine=c("C","R"), silent=FALSE, ...)}
Expand Down
2 changes: 1 addition & 1 deletion man/parboot.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
\alias{plot,parboot,missing-method}
\alias{show,parboot-method}

\title{Parametric bootstrap method for \code{unmarked} models}
\title{Parametric bootstrap for \code{unmarked} models}

\description{Simulate datasets from a fitted model, refit the model, and
generate a sampling distribution for a user-specified fit-statistic.}
Expand Down
2 changes: 1 addition & 1 deletion man/pcountOpen.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\name{pcountOpen}
\alias{pcountOpen}
\title{Fit the open N-mixture models of Dail and Madsen and extensions}
\title{Fit the open N-mixture models of Dail and Madsen (2011) and Hostetler and Chandler (2015)}
\description{Fit the models of Dail and Madsen (2011) and Hostetler and
Chandler (in press), which are
generalized forms of the Royle (2004) N-mixture model for open
Expand Down
2 changes: 1 addition & 1 deletion man/powerAnalysis.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
\alias{powerAnalysis,list-method}
\alias{powerAnalysis,unmarkedFit-method}

\title{Conduct a power analysis for an unmarked model}
\title{Conduct a power analysis for an \code{unmarked} model}

\description{
This function uses a simulation-based approach to estimate power for parameters
Expand Down
3 changes: 3 additions & 0 deletions man/ranef.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ for methods used to manipulate the returned object.

\author{Richard Chandler \email{rbchan@uga.edu}}

\seealso{
\code{\link{unmarkedRanef-class}}, \code{\link{bup}}
}

\references{
Laird, N.M. and T.A. Louis. 1987. Empirical Bayes confidence intervals
Expand Down
2 changes: 1 addition & 1 deletion man/simulate.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
\alias{simulate,unmarkedFrame-method}
\alias{simulate,character-method}

\title{Data simulation in unmarked}
\title{Simulate datasets from any \code{unmarked} model type}
\description{
Simulate data from a fitted model, or simulate an entirely new dataset
from a study design defined by an \code{unmarkedFrame}.
Expand Down
58 changes: 58 additions & 0 deletions man/unmarkedModSel-class.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
\name{unmarkedModSel-class}
\title{unmarkedModSel class and methods}
\alias{unmarkedModSel-class}
\alias{show,unmarkedModSel-method}
\alias{coef,unmarkedModSel-method}
\alias{SE,unmarkedModSel-method}

\description{The unmarkedModSel class and associated methods}

\section{Slots}{
\describe{
\item{Full}{data.frame with formula, estimates, standard errors and model
selection information. Converge is optim convergence code. CondNum is
model condition number. n is the number of sites. delta is delta AIC.
cumltvWt is cumulative AIC weight.
Rsq is Nagelkerke's (1991) R-squared index, which is only returned when
the nullmod argument is specified. }
\item{Names}{matrix referencing column names of estimates (row 1) and
standard errors (row 2).}
}
}
\section{Methods}{
\describe{
\item{show}{Print the AIC model selection table}
\item{coef}{Data frame of coefficients from all models in model selection table}
\item{SE}{Data frame of coefficient SEs from all models in model selection table}
}
}
\seealso{\code{\link{modSel}}}
\examples{
data(linetran)
(dbreaksLine <- c(0, 5, 10, 15, 20))
lengths <- linetran$Length * 1000
ltUMF <- with(linetran, {
unmarkedFrameDS(y = cbind(dc1, dc2, dc3, dc4),
siteCovs = data.frame(Length, area, habitat), dist.breaks = dbreaksLine,
tlength = lengths, survey = "line", unitsIn = "m")
})
fm1 <- distsamp(~ 1 ~1, ltUMF)
fm2 <- distsamp(~ area ~1, ltUMF)
fm3 <- distsamp( ~ 1 ~area, ltUMF)
fl <- fitList(Null=fm1, A.=fm2, .A=fm3)
fl
ms <- modSel(fl, nullmod="Null")
ms
coef(ms) # Estimates only
SE(ms) # Standard errors only
(toExport <- as(ms, "data.frame")) # Everything
}
Loading

0 comments on commit d652d38

Please sign in to comment.