optME: Optimizing ME

Description Usage Arguments Details Value See Also Examples

View source: R/fastRcrit.R

Description

Computes optimal category orders for each dimension separately. Uses a TSP solver to achieve the best ME value.

Usage

1
2
3
optME(x, dims = NULL, nstart = 1,
 solver = "nearest_insertion",
  return.table = TRUE, adjust.dist = FALSE)

Arguments

x

A matrix, table or array.

dims

Which dimensions to reorder. The dimensions are reordered independently.

nstart

The number of different starting points for the TSP solver. If nstart is greater or equal to the number of cities in a dimension, the solver uses each city once.

solver

Should be one of "nn", "nearest_insertion", "cheapest_insertion","farthest_insertion". See solve_TSP.

return.table

Whether or not to return the optimized table. If FALSE only the new category orders are returned. If TRUE the new orders are attached to the table as an attribute "orders".

adjust.dist

If TRUE a small proportion of the euclidean distances between the category profiles (e.g. rows) is added to the ME distance value. The idea is to keep identical profiles together which is otherwise not guaranteed, since the ME values can be identical even if the profiles aren't.

Details

Each dimension is optimized separately via a TSP solver.

Value

The passed object as a table with optimized category orders.

See Also

ME

Examples

1
2
3
4
a <- arsim(2000,c(8,9,10),3,0.2)
ME(a)
a2<-optME(a)
ME(a2)

extracat documentation built on July 17, 2018, 5:05 p.m.

Related to optME in extracat...