Validate Market Data and Detect Outliers in Price Per Kilogram
validate_market.Rd
This function processes market data to identify outliers in the price per kilogram.
It selects necessary columns,
unnests market data, and calculates the price per kilogram. The data is grouped
by gear type, market group, and
species in the market. Outliers are detected using the alert_outlier
function,
which applies the LocScaleB method
for outlier detection based on the Median Absolute Deviation (MAD) method.
The k
parameter is used within the MAD
method to determine the extension of bounds for outlier detection.
Arguments
- data
A data frame containing market information. Expected to include columns
_id
,gear_type
, andmarket
.- k_max_price
Nonnegative constant used in the LocScaleB function, based on the MAD method, to determine the extension of bounds for outlier detection in price per kilogram. Common values are 2, 2.5, and 3.