mechanical: mechanical model: use an exponential function to describe the...

Description Usage Arguments Details Value Examples

View source: R/mechanical.R

Description

mechanical model: use an exponential function to describe the coefficients away from roads

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mechanical(
  variabledf,
  y_var = c("day_value", "night_value", "value_mean"),
  pop_var = "pop3k",
  distance_centre,
  roadtypes = 3,
  buffers_in,
  buffers_out,
  training,
  test,
  nls2start = NA,
  Road_varname = "ROAD",
  normalize = F
)

Arguments

variabledf

the dataframe containing predictors and dependent variable

y_var

name of the dependent variable.

pop_var

the name of an additional variable as a linear term, usually population withn a buffer, a string.

distance_centre

the distance to centre from each buffer. (b2-b1)/2 + b1

training

the index for the rows used for training.

test

the index for the rows used for testing.

nls2start

the start value for nls2. if providing an nls2start, the nls2 from nls2 package is used. Details see nls2.

Road_varname

the name of variables contains road buffers, e.g. 'ROAD'

normalize

if True, the road ring is normalised by the area (default is false)

Details

This method used nls for modelling. This function also prints errormatrix, the exponential model; plot coefficient. The modelling and evaluation should be separated at a later stage, now putting together for exploration only.

Value

An object of nls

Examples

1
mechanical(inde_var,'day_value',pop_var = 'pop5k', distance_centre = distance_centre, training, test)

mengluchu/APMtools documentation built on Jan. 27, 2022, 2:41 a.m.