Handle analysis-specific parameters.
387 {
388 try {
389 if (name == "method") {
390 try {
391 auto method_str = safe_any_cast_or_throw<std::string>(value);
393 } catch (const std::runtime_error&) {
394 auto method_enum = safe_any_cast_or_throw<StatisticalMethod>(value);
396 }
397 } else if (name == "window_size") {
398 auto size = safe_any_cast_or_throw<uint32_t>(value);
401 } else if (name == "hop_size") {
402 auto size = safe_any_cast_or_throw<uint32_t>(value);
405 } else if (name == "classification_enabled") {
406 auto enabled = safe_any_cast_or_throw<bool>(value);
408 } else if (name == "percentile") {
409 auto percentile = safe_any_cast_or_throw<double>(value);
410 if (percentile < 0.0 || percentile > 100.0) {
411 throw std::invalid_argument("Percentile must be between 0.0 and 100.0, got: " + std::to_string(percentile));
412 }
414 } else if (name == "sample_variance") {
415 auto sample = safe_any_cast_or_throw<bool>(value);
417 } else {
419 }
420 } catch (const std::runtime_error& e) {
422 }
423 }
double m_percentile_value
void validate_window_parameters() const
Validate window parameters.
static StatisticalMethod string_to_method(const std::string &str)
Convert string to statistical method enum.
StatisticalMethod m_method
bool m_classification_enabled
virtual void set_analysis_parameter(const std::string &name, std::any value)
Analysis-specific parameter handling (override for custom parameters)
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
std::vector< double > percentile(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, double percentile_value)
Arbitrary percentile per window via linear interpolation.