Outliers Calculation:
From: | To: |
Outliers are data points that differ significantly from other observations. In a normal distribution, they typically fall outside the range of mean ± 3 standard deviations. This calculator simulates a normal distribution using torch.normal parameters and identifies outliers based on the 3-sigma rule.
The calculator uses the following approach:
Where:
Explanation: The calculator generates normally distributed random numbers with specified mean and SD, then counts how many fall outside the 3-sigma range.
Details: In a perfect normal distribution, about 0.3% of values should be outliers (3 in 1000). The actual percentage may vary slightly in small samples due to random variation.
Tips: Enter the desired mean and standard deviation for your normal distribution, along with how many random values to generate. The calculator will show how many outliers exist in the simulated dataset.
Q1: Why use 3 standard deviations?
A: 3-sigma captures 99.7% of data in a normal distribution, making it a common threshold for identifying extreme values.
Q2: How does this relate to torch.normal?
A: torch.normal(mean, std) generates tensors with values from a normal distribution - this calculator simulates that process in PHP.
Q3: What if I get more outliers than expected?
A: With small sample sizes, random variation can cause more or fewer outliers than the theoretical 0.3%.
Q4: Can I use different sigma thresholds?
A: This calculator uses 3-sigma, but you could modify the code for 2-sigma (95% interval) or other thresholds.
Q5: How accurate is the PHP simulation?
A: The Box-Muller transform used here approximates normal distribution, though torch.normal may use more sophisticated methods.