Learn R Programming

factree (version 0.1.0)

find_best_split: Find the Best Split for a Node

Description

Internal function to iterate through all possible split points in all covariates to find the split that minimizes the split statistic.

Usage

find_best_split(X_node, Y_node, indices, r_a, r_b, control)

Value

A list containing the best split found, including the statistic, split variable, split value, and indices for the left and right children.

Arguments

X_node

Covariate matrix for the current node.

Y_node

Time series matrix for the current node.

indices

Original indices of the observations in the current node.

r_a

Parameter passed to `calculate_split_statistic`.

r_b

Parameter passed to `calculate_split_statistic`.

control

The parameters used in split.