mfm: Find a sample representative of a given population by...

Description Usage Arguments Value Examples

View source: R/mfm.R

Description

Find a sample representative of a given population by multifunctional matching

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mfm(
  data,
  listfns,
  listinputs,
  coordX = NULL,
  coordY = NULL,
  minDistance = 0,
  nDraws,
  sizeSample,
  methodNormalization,
  weightsfns = NULL,
  progressBar = TRUE
)

Arguments

data

the dataframe to use

listfns

the list of functionals

listinputs

the list of inputs, where each input is a vector of columns corresponding to each functional

coordX

the vector of X-coordinates

coordY

the vector of Y-coordinates

minDistance

minimum distance between two observations of the selected sample

nDraws

the number of random samples to generate from the population

sizeSample

the size of the sample

methodNormalization

the method used for normalization. Can be ecdf for normalization by the empirical cumulative distribution function or meansd for the normalization (X-E[X])/sd(X).

weightsfns

weights for each of the functionals. These weights can be used to give more or less importance to some of the functionals. It should be a vector of the same length as the listfns.

progressBar

TRUE: display a progressbar

Value

a list with two elements

Examples

1
2
3
4
# matching the first mean of a two-dimensional dataset
df = data.frame(rnorm(2000), rnorm(2000))
mfm(data = df, listfns = list(mean), listinputs = list(1),
    nDraws = 500, sizeSample = 10, methodNormalization = "ecdf")

AlexisDerumigny/MFunctMatching documentation built on Dec. 31, 2020, 9:47 a.m.