Package 'lhreg'

Title: Phylogeny and Species Trait Effects on Detectability
Description: Phylogeny and species trait effects on detectability, supporting material for the manuscript entitled 'Phylogeny and species traits predict songbird detectability' by Solymos, Matsuoka, Stralberg, Bayne, and Barker.
Authors: Peter Solymos [cre, aut]
Maintainer: Peter Solymos <[email protected]>
License: GPL-2
Version: 0.2-1
Built: 2024-09-02 02:53:36 UTC
Source: https://github.com/borealbirds/lhreg

Help Index


Phylogenetic Correlation Matrix

Description

Phylogenetic correlation matrix.

Usage

data("cor_matrix")

Format

A matrix.

Source

See manuscript.

References

Manuscript.

Examples

data(cor_matrix)
str(cor_matrix)

Phylogeny and Species Trait Effects on Detectability

Description

Functions used in the manuscript.

Usage

lhreg(Y, X, SE, V, init=NULL, lambda=NA, method="Nelder-Mead",
    hessian=FALSE, DElimit=10, eval=FALSE)

## S3 method for class 'lhreg'
logLik(object, ...)
## S3 method for class 'lhreg'
summary(object, ...)
## S3 method for class 'lhreg'
simulate(object, nsim = 1, seed = NULL,
    lambda = NA, obs_error = FALSE, ...)
profile_lambda1(object, value, ...)

loo1(i, object, return_coefs=TRUE)
loo2(i, object, return_coefs=TRUE, method=NULL)

parametric_bootstrap(object, nsim=1, seed = NULL, method, cl=NULL, ...)
pred_int(object, boot, cl=NULL)

Arguments

Y

response vector.

X

model matrix for the mean.

SE

standard error estimate (observation error) for the response.

V

correlation matrix.

init

initial values or NULL.

lambda

phylogeny strength, non-negative, NA means it is not fixed value but estimated.

method

method argument accepted by optim, or "DE" when DEoptim is called. Method for loo2 is same as for the input object$method by default (method=NULL).

hessian

logical, if the Hessian needs to be estimated at MLE.

DElimit

limit for DEoptim search (used as [-DElimit, +DElimit]) when method = "DE".

eval

logical, the negative log-likelihood is evaluated at init given the data arguments without optimization.

object

a fitted object returned by lhreg.

value

fixed value for lambda in profile likelihood calculations.

i

index of observations to drop for cross-validation.

nsim

number of response vectors to simulate. Defaults to 1.

seed

an object specifying if and how the random number generator should be initialized as described in simulate.

obs_error

logical, if observation error is to be taken into account.

cl

number of parallel processes or cluser object.

return_coefs

logical, if (re)estimated coefficients are to be returned.

boot

an object with parametric_bootstrap results.

...

other arguments passed to underlying functions.

Details

See Examples and Vignettes for details.

Value

lhreg returns an object of lhreg, that is a list.

The summary method returns a summary for the input object. The logLik method returns the log-likelihood. The simulate method returns the random deviates under a multivariate normal model.

profile_lambda1 returns log-likelihood based on fixed lambda profile likelihood.

loo1 returns the observed value for the held-out data point and the corresponding prediction based on multiple linear regression. Also returns coefficients based on the training data when return_coefs=TRUE.

loo2 returns the observed value for the held-out data point and the corresponding prediction based on correlated mixed-effects model. Also returns coefficients based on the training data when return_coefs=TRUE.

parametric_bootstrap uses the simulate method to simulate observations from a Multivariate Normal distribution according to the input object (without the observation error) to refit the model and returns simulated values and estimates.

pred_int calculates the prediction interval for an observation conditional on the other species and the known tree (this one and the other species included), and returns the bootstrap distribution of the prediction that can be used to calculate quantile based prediction intervals.

Author(s)

Peter Solymos <[email protected]>

See Also

optim, DEoptim

Examples

## see examples in the vignette
## Not run: 
vignette(topic = "lhreg", package = "lhreg")

## End(Not run)

Life History Traits

Description

Life history traits.

Usage

data("lhreg_data")

Format

A data frame.

Source

See manuscript.

References

Manuscript.

Examples

data(lhreg_data)
str(lhreg_data)