fit_it: Fit a model using Genaralized Simulated Annealing (SA)...

Description Usage Arguments Value Note Author(s)

Description

Fit the paramaters of a given model to data using SA. Can be slow for large datasets.

Usage

1
2
3
4
fit_it(model, Tlevel1, Tlevel2, mean_Tlevel1, sd_Tlevel1, pars = c(a0 = 0, a1
  = 0, b0 = 0, b1 = 0), par_lo = c(a0 = -5000, a1 = -5000, b0 = -5000, b1 =
  -5000), par_hi = c(a0 = 5000, a1 = 5000, b0 = 5000, b1 = 5000),
  max.time = 1800)

Arguments

model

One of the three models implemented integrated_model, niche_model or neutral_model.

Tlevel1

Vector of trait values of the first interaction partner.

Tlevel2

Vector of trait values of the second interaction partner.

mean_Tlevel1

Mean of trait values of the first interaction partner. Can be weighted or not, and can use independent information on the trait distribution to be calculated.

sd_Tlevel1

Standard deviation of trait values of the first interaction partner. Can be weighted or not, and can use independent information on the trait distribution to be calculated.

pars

a vector of the form c(a0 = 0, a1 = 0, b0 = 0, b1 = 0) with the initial parameters.

max.time

value in seconds to stop the estimation of params. Set to 1800 (30 minuts)

pars_lo

a vector of the form c(a0 = 0, a1 = 0, b0 = 0, b1 = 0) with the lower limits that the parameters can reach. You can use a priosy information to constrain the posible values of the parameters (e.g. the slope, a1, has to be positive)

pars_hi

a vector of the form c(a0 = 0, a1 = 0, b0 = 0, b1 = 0) with the higher limits that the parameters can reach. You can use a priosy information to constrain the posible values of the parameters

Value

a vector with the estimated parameters of the form c(a0 = x, a1 = y, b0 = z, b1 = w)

Note

See readme file here: https://github.com/ibartomeus/trait_match

Author(s)

Dominique Gravel and Ignasi Bartomeus


ibartomeus/traitmatch documentation built on May 18, 2019, 1:29 a.m.