Computes the fitness of a candidate in the genetic algorithm displayed in function Lorenz.GA.cpp
.Fitness_cpp(x, Y, X, Z, pi, tolerance)
Fitness of candidate x
vector of size (p-1) giving the proposed candidate, where p is the number of covariates
vector of size n gathering the response, where n is the sample size
matrix of dimension (n*p) gathering the covariates
vector of size n gathering iid repetitions of a U[0,1]
vector of size n gathering the observation weights (notice that sum(pi)=1)
A small positive number used to determine the threshold for considering two floating-point numbers as equal. This is primarily used to address issues with floating-point precision when comparing values that should theoretically be identical but may differ slightly due to numerical inaccuracies.