SETSe: SETSe algorithm The basic SETSe function.

Description Usage Arguments Details Value See Also Examples

View source: R/SETSe.R

Description

SETSe algorithm

The basic SETSe function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
SETSe(
  g,
  force = "force",
  distance = "distance",
  edge_name = "edge_name",
  k = "k",
  tstep = 0.02,
  mass = 1,
  max_iter = 20000,
  coef_drag = 1,
  tol = 1e-06,
  sparse = FALSE,
  two_node_solution = TRUE,
  sample = 1,
  static_limit = NULL,
  noisy_termination = TRUE
)

Arguments

g

An igraph object

force

A character string. This is the node attribute that contains the force the nodes exert on the network.

distance

A character string. The edge attribute that contains the original/horizontal distance between nodes.

edge_name

A character string. This is the edge attribute that contains the edge_name of the edges.

k

A character string. This is k for the moment don't change it.

tstep

A numeric. The time interval used to iterate through the network dynamics.

mass

A numeric. This is the mass constant of the nodes in normalised networks this is set to 1.

max_iter

An integer. The maximum number of iterations before stopping. Larger networks usually need more iterations.

coef_drag

A numeric.

tol

A numeric. The tolerance factor for early stopping.

sparse

Logical. Whether or not the function should be run using sparse matrices. must match the actual matrix, this could prob be automated

two_node_solution

Logical. The Newton-Raphson algo is used to find the correct angle

sample

Integer. The dynamics will be stored only if the iteration number is a multiple of the sample. This can greatly reduce the size of the results file for large numbers of iterations. Must be a multiple of the max_iter

static_limit

Numeric. The maximum value the static force can reach before the algorithm terminates early. This prevents calculation in a diverging system. The value should be set to some multiple greater than one of the force in the system. If left blank the static limit is twice the system absolute mean force.

noisy_termination

Stop the process if the static force does not monotonically decrease.

Details

This is the basic SETS embeddings algorithm, it outputs all elements of the embeddings as well as convergence dynamics. It is a wrapper around the core SETS algorithm which requires data preparation and only produces node embeddings and network dynamics. There is little reason to use this function as SETSe_auto and SETSe_bicomp are faster and easier to use.

Value

A list of three elements. A data frame with the height embeddings of the network, a data frame of the edge embeddings as well as the convergence dynamics dataframe for the network.

See Also

SETSe_auto SETSe_bicomp

Examples

1
2
3
4
5
6
7
8
9
set.seed(234) #set the random see for generating the network
g <- generate_peels_network(type = "E")
embeddings <- g %>%
#prepare the network for a binary embedding
prepare_SETSe_binary(., node_names = "name", k = 1000, 
                     force_var = "class", 
                     positive_value = "A") %>%
#embed the network using SETSe
  SETSe()

rsetse documentation built on Nov. 12, 2020, 5:08 p.m.