<commit_before>package hrv.calc.parameter;

import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation;

import hrv.RRData;

public class SD2Calculator implements HRVDataProcessor {

	@Override
	public HRVParameter process(RRData data) {
		SDSDCalculator sdsdCalc = new SDSDCalculator();
		double sdsd = sdsdCalc.process(data).getValue();
		StandardDeviation sdnnCalc = new StandardDeviation();
		double sdnn = sdnnCalc.evaluate(data.getValueAxis());
		double val = 2 * sdsd * sdsd - 0.5 * sdnn * sdnn;
		return new HRVParameter(HRVParameterEnum.SD1SD2, Math.sqrt(val), "non");
	}

	@Override
	public boolean validData(RRData data) {
		return data.getValueAxis().length > 1;
	}
}
<commit_msg>fixed #139 in hrv-band<commit_after>package hrv.calc.parameter;

import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation;

import hrv.RRData;

public class SD2Calculator implements HRVDataProcessor {

	@Override
	public HRVParameter process(RRData data) {
		SDSDCalculator sdsdCalc = new SDSDCalculator();
		double sdsd = sdsdCalc.process(data).getValue();
		StandardDeviation sdnnCalc = new StandardDeviation();
		double sdnn = sdnnCalc.evaluate(data.getValueAxis());
		double val = 2 * sdsd * sdsd - 0.5 * sdnn * sdnn;
		return new HRVParameter(HRVParameterEnum.SD2, Math.sqrt(val), data.getValueAxisUnit().toString());
	}

	@Override
	public boolean validData(RRData data) {
		return data.getValueAxis().length > 1;
	}
}

{'fraction_non_alphanumeric': 0.10702341137123746, 'fraction_numerical': 0.012040133779264214, 'mean_word_length': 4.362007168458781, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5521353', 'n_tokens_mistral': 537, 'n_tokens_neox': 489, 'n_words': 105}