select_model: compute the data pairwise and and selects a pair with the...

View source: R/select_model.R

select_modelR Documentation

compute the data pairwise and and selects a pair with the lowest "MD" value.

Description

compute the data pairwise using function calculate_model and selects a pair with the lowest "MD" value.

Usage

select_model(candidate, data_candidate, merged_data,
  overlapValues = door_default_values("overlapValues"),
  merged = door_default_values("merged"))

Arguments

candidate

a character vector, contains the names of studies.

data_candidate

a data frame, odorant response data that only contains value columns.

merged_data

numeric vector, merged data

overlapValues

numeric, a criterion using to refuse a data set that has not enough overlap value.

merged

logical, if merged is TRUE, calculate models between merged_data and candidate data. If FALSE, calculate models between candidates.

Details

This function is used in model_response to select the first pair or next data set for merging. The output is a list containing "selected.x" and "selected.y" that specify which data plots against another, and "best.model" that is used in function project_points.

Author(s)

Shouwen Ma <shouwen.ma@uni-konstanz.de>

See Also

project_points,model_response

Examples

# load data
library(DoOR.data)
data(ac3B)

# split into data and header
studies <- names(ac3B)[c(7:8)]
data_candidate <- ac3B[,c(7:8)]

# rescale data
norm_data_candidate <- apply(data_candidate, 2, door_norm)

# find the best fitting model
select_model(candidate = studies, data_candidate = norm_data_candidate,
             merged = FALSE)


Dahaniel/DoOR.functions documentation built on Feb. 20, 2024, 7:04 p.m.