Handle analysis-specific parameters.
398 {
399 try {
400 if (name == "method") {
401 try {
402 auto method_str = safe_any_cast_or_throw<std::string>(value);
404 } catch (const std::runtime_error&) {
405 auto method_enum = safe_any_cast_or_throw<StatisticalMethod>(value);
407 }
408 } else if (name == "window_size") {
409 auto size = safe_any_cast_or_throw<uint32_t>(value);
412 } else if (name == "hop_size") {
413 auto size = safe_any_cast_or_throw<uint32_t>(value);
416 } else if (name == "classification_enabled") {
417 auto enabled = safe_any_cast_or_throw<bool>(value);
419 } else if (name == "percentile") {
420 auto percentile = safe_any_cast_or_throw<double>(value);
421 if (percentile < 0.0 || percentile > 100.0) {
422 throw std::invalid_argument("Percentile must be between 0.0 and 100.0, got: " + std::to_string(percentile));
423 }
425 } else if (name == "sample_variance") {
426 auto sample = safe_any_cast_or_throw<bool>(value);
428 } else {
430 }
431 } catch (const std::runtime_error& e) {
433 }
434 }
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.