fit_model: Fit a simple model to pairwise data

Description Usage Arguments

View source: R/main.R

Description

Using data already loaded into an RMAPI project, fits a simple model of pairwise statistical distances against spatial distances. This model can be used in the simulation step to generate a null expectation against which to compare. The available models are:

  1. Linear model, y = a*x + b

  2. Asymptotic model, y = alpha + (beta - alpha)*exp(-exp(log_lambda)*x)

  3. Power model, codey = a*x^b + c

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fit_model(
  proj,
  type = 1,
  x_min = -Inf,
  x_max = Inf,
  y_min = -Inf,
  y_max = Inf,
  a_init = 1,
  b_init = 1,
  c_init = 1
)

Arguments

proj

object of class rmapi_project.

type

which model to fit to the data: 1 = linear model, 2 = asymptotic model, 3 = power model.

x_min, x_max, y_min, y_max

can be used to mask out values outside a specified range.

a_init, b_init, c_init

initial values used in model fitting for models 1 and 3.


mrc-ide/RMAPI documentation built on Feb. 11, 2020, 4:53 a.m.