fit4corner: Fit fourth corner prediction model

Description Usage Arguments Details Value Author(s)

View source: R/fit4corner.R

Description

Fit fourth corner prediction model using either the approach proposed by Brown et al. (2014) (traitglm) or Ovaskainen et al. (2017) (hmsc).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fit4corner(
  data,
  formulaFrom = "~ .",
  formulaTo = "~ .",
  binary = TRUE,
  type = "HMSC",
  family = NULL,
  priors = NULL,
  iniParam = NULL,
  ...
)

Arguments

data

an object of the class alienData, see as.alienData function.

formulaFrom

A one-sided formula specifying how to construct the trait variables associated to the "From" organisms. Default is "~ .".

formulaTo

A one-sided formula specifying how to construct the trait variables associated to the "To" organisms. Default is "~ .".

binary

Logical. Whether the adjacency matrix is binary or not. Default is TRUE.

type

Method to be used to estimate the model. Either 'mvabund' or 'HMSC' for the implementation of the 'mvabund' (traitglm) or the 'HMSC' (hmsc) R package, respectively.

family

For 'mvabund', the family of the response variable can be defined using family. The negative binomial with unknown overdispersion and a log-link can be specified as "negative.binomial", and it is the default. For 'HMSC', use either 'probit', 'logit', 'gaussian', 'poisson', 'overPoisson'.

priors

An object of class HMSCprior (as.HMSCprior). If NULL, the function will generate flat priors to estimate the model. This argument is active only when "HMSC" is used.

iniParam

An object of class HMSCparam (as.HMSCparam). If NULL, the function will generate initial parameters ramdomly. This argument is active only when "HMSC" is used.

...

Other parameters passed to either traitglm or hmsc.

Details

The fourth corner models are designed to be used on bipartite network where traits are available for both sets of species interacting in the network. It should not be used otherwise.

The fourth corner models assume that adjacency matrix (species by species matrix) used to perform the analysis has as rows the "From" species and as columns the "To" species.

The arguments formulaFrom and formulaTo should take the form ~ x + y * z, that is, the left side of the equation should not be given. Also, note that the default formulas always include an intercept.

Value

An object of class alienFit.

Author(s)

F. Guillaume Blanchet


TheoreticalEcosystemEcology/alien documentation built on Feb. 21, 2020, 7:12 p.m.