getStarts: Get order of starting values for an unmarked model

View source: R/utils.R

getStartsR Documentation

Get order of starting values for an unmarked model

Description

This function provides a named vector of starting values for a given unmarked model, to serve as a guide for providing your own starting values. To use it, write the code to fit an unmarked model and then wrap the code in getStarts() (see example below). Note that due to environment/scoping issues, this function may not work if you call it from inside other functions.

Usage

getStarts(code)

Arguments

code

A line of R code creating an unmarkedFit object

Value

A named vector showing the correct order of starting values

Examples

# Create unmarkedFrame
data(frogs)
pferUMF <- unmarkedFrameOccu(pfer.bin)
siteCovs(pferUMF) <- data.frame(sitevar1 = rnorm(numSites(pferUMF)))
obsCovs(pferUMF) <- data.frame(obsvar1 = rnorm(numSites(pferUMF) * obsNum(pferUMF)))

# Get correct sequence of starting values for model
getStarts(occu(~ obsvar1 ~ 1, pferUMF))

unmarked documentation built on Aug. 20, 2026, 9:07 a.m.