qat (version 0.74)

qat_analyse_histogram_test_kld_1d: Perform a histogram test with the metric KLD

Description

This check divides the data into blocks, estimates their probability density functions by histograms and compares them by using the Kullback-Leibler Divergence.

Usage

qat_analyse_histogram_test_kld_1d(measurement_vector, blocksize =  floor(length(measurement_vector)/20), numofbars = 65, factorofbar = 100)

Arguments

measurement_vector
The measurement vector, which should be tested
blocksize
Number of elements in the first dimension, which should be used for each block
numofbars
Number of bins of the histogram
factorofbar
Correction factor for non-value bins

Value

Details

The vector will be divided into blocks, with a length given by the parameter blocksize. From these blocks histograms are computed and afterwards compared. As a metric for the comparison the Kullback-Leibler Divergence is used. As a result a field is generated, which includes the results of the comparison between every combination of blocks.

References

Duesterhus, A., Hense, A. (2012) Advanced Information Criterion for Environmental Data Quality Assurance, \_Advances in Science and Research\_, *8*, 99-104.

See Also

qat_analyse_histogram_test_kld_2d, qat_analyse_histogram_test_jsd_1d, qat_analyse_histogram_test_rms_1d, qat_analyse_histogram_test_ms_1d, qat_analyse_histogram_test_emd_1d

Examples

Run this code
vec <- c(rnorm(1000), round(rnorm(1000)))
result <- qat_analyse_histogram_test_kld_1d(vec, 50, 65, 100)
qat_plot_histogram_test(result$field, "test_kld_1d", result$blocksize, 
result$numofbars, result$factorofbar, "kld", result$runs)

Run the code above in your browser using DataCamp Workspace