protected function logLikelihood(Matrix $z) : array
    {
        $likelihoods = array_fill(0, $z->n(), 0.);
        
        foreach ($z as $i => $values) {
            [$edges, $counts, $densities] = $this->histograms[$i];

            foreach ($values as $j => $value) {
                foreach ($edges as $k => $edge) {
                    if ($value < $edge) {
                        $likelihoods[$j] += $densities[$k];

                        break 1;
                    }
                }
            }
        }

        foreach ($likelihoods as &$likelihood) {
            $likelihood /= $this->estimators;
        }

        return $likelihoods;
    }
protected function logLikelihood(Matrix $z) : array
    {
        $likelihoods = array_fill(0, $z->n(), 0.);
        
        foreach ($z as $i => $values) {
            [$edges, $counts, $densities] = $this->histograms[$i];

            foreach ($values as $j => $value) {
                foreach ($edges as $k => $edge) {
                    if ($value < $edge) {
                        $likelihoods[$j] += $densities[$k];

                        break 1;
                    }
                }
            }
        }

        foreach ($likelihoods as &$likelihood) {
            $likelihood /= $this->estimators;
        }

        return $likelihoods;
    }
protected function logLikelihood ( Matrix $ z ) : array { $ likelihoods = array_fill ( 0 , $ z -> n ( ) , 0. ) ; foreach ( $ z as $ i => $ values ) { [ $ edges , $ counts , $ densities ] = $ this -> histograms [ $ i ] ; foreach ( $ values as $ j => $ value ) { foreach ( $ edges as $ k => $ edge ) { if ( $ value < $ edge ) { $ likelihoods [ $ j ] += $ densities [ $ k ] ; break 1 ; } } } } foreach ( $ likelihoods as & $ likelihood ) { $ likelihood /= $ this -> estimators ; } return $ likelihoods ; }
Return the negative log likelihoods of each projection.

@param \Rubix\Tensor\Matrix $z
@return array
Return the negative log likelihoods of each projection .