Learn R Programming

dbnR (version 0.7.1)

natPsoCtrl: R6 class that defines the PSO controller

Description

Constructor of the 'natPsoCtrl' class

If the names of the nodes have "_t_0" appended at the end, remove it

Initialize the particles for the algorithm to random positions and velocities.

Arguments

n_it

maximum number of iterations of the pso algorithm

in_cte

parameter that varies the effect of the inertia

gb_cte

parameter that varies the effect of the global best

lb_cte

parameter that varies the effect of the local best

r_probs

vector that defines the range of random variation of gb_cte and lb_cte

cte

boolean that defines whether the parameters remain constant or vary as the execution progresses

nodes

a vector with the names of the nodes

ordering

a vector with the names of the nodes in t_0

max_size

maximum number of timeslices of the DBN

n_inds

number of particles that the algorithm will simultaneously process

v_probs

vector that defines the random velocity initialization probabilities

p

parameter of the truncated geometric distribution for sampling edges

score

bnlearn score function used

Value

A new 'natPsoCtrl' object

the ordering with the names cropped

Details

The controller will encapsulate the particles and run the algorithm. This time, it extends the class "PsoCtrl" in the "structure_learning_psoho.R" file, because both controllers are practically the same. The particles, positions and velocities are too different to extend one another though.