Learn R Programming

unmarked (version 1.5.2)

getStarts: 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)

Value

A named vector showing the correct order of starting values

Arguments

code

A line of R code creating an unmarkedFit object

Examples

Run this code
# 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))

Run the code above in your browser using DataLab