Domain: Financial & Accounting

You are conducting a post-event statistical analysis of Domino's Pizza Inc. equity trading behavior during periods of extreme market stress using the dataset OTS_DS_0335_DOMINOS.csv, which contains daily stock market observations with columns Date (string, trading date), Open (continuous numeric, opening price), High (continuous numeric, intraday high), Low (continuous numeric, intraday low), Close (continuous numeric, closing price), Adj Close (continuous numeric, adjusted closing price), and Volume (integer, number of shares traded); restrict the analysis strictly to calendar year 2020, compute daily percentage returns as decimal values using the formula (Adj Close_t / Adj Close_{t-1} - 1), remove the first trading day of the year from return-based calculations, calculate the full return distribution statistics including median, 25th percentile, 75th percentile, and interquartile range, define return outliers using the 1.5×IQR rule where outliers are values below Q1 - 1.5×IQR or above Q3 + 1.5×IQR, compute the 75th percentile of trading volume and classify high-volume days as those with volume strictly above this threshold, compute the mean daily return and the probability of a positive return conditional on high-volume days, compute the rolling 5-day trailing standard deviation of daily returns using the sample standard deviation formula (ddof=1), identify both its maximum value and the corresponding date, compute the Pearson correlation between daily trading volume and absolute daily returns after removing missing values, apply z-score normalization to daily returns using the population standard deviation (ddof=0) and count the number of days with absolute z-scores exceeding 3, identify the single highest-volume trading day of 2020 and report its date and daily return, and finally compute the mean daily return during the most volatile consecutive 10-trading-day period of the year as defined by the highest average rolling 5-day volatility; report all percentile-based values as exact decimals rounded to six decimal places, report probabilities rounded to six decimal places, report correlations rounded to six decimal places, report volatility measures rounded to six decimal places, report all other decimal values rounded to six decimal places unless otherwise specified, and report dates in YYYY-MM-DD format.

Grading rubric:
criterion: The median daily return for 2020 equals 0.000982 when rounded to six decimal places.
weight: 15
criterion: The 25th percentile of daily returns equals -0.009999 when rounded to six decimal places.
weight: 15
criterion: Exactly 17 trading days in 2020 are classified as return outliers.
weight: 15
criterion: The 75th percentile of trading volume equals 889500.
weight: 15
criterion: High-volume days are defined as days with volume strictly greater than 889500.
weight: 10
criterion: The conditional probability of a positive return given high volume equals 0.492063 when rounded to six decimal places.
weight: 15
criterion: The maximum rolling 5-day return standard deviation equals 0.117244 when rounded to six decimal places.
weight: 20
criterion: Exactly 3 trading days have absolute return z-scores greater than 3.
weight: 15
criterion: The highest trading volume observed in 2020 occurs on 2020-05-11.
weight: 15
criterion: The daily return on the highest-volume trading day equals 0.022689 when rounded to six decimal places.
weight: 15

Golden answer:
### Step-by-Step Explanation

**Step 1: Load and Filter Data**
- Load the CSV file containing Domino's stock data
- Convert Date column to datetime format
- Filter to include only trading days in calendar year 2020

**Step 2: Compute Daily Percentage Returns**
- Calculate daily returns as (Adj Close_t / Adj Close_{t-1} - 1) in decimal format
- Remove the first trading day of 2020 from return-based calculations (this day has no prior close)

**Step 3: Return Distribution Statistics**
- Compute median, 25th percentile (Q1), 75th percentile (Q3), and IQR = Q3 - Q1
- Identify outliers using 1.5×IQR rule: values < Q1 - 1.5×IQR or > Q3 + 1.5×IQR
- Count the number of outlier days

**Step 4: Volume Analysis**
- Compute the 75th percentile of trading volume
- Identify high-volume days as those with Volume > 75th percentile (strictly greater than)
- For high-volume days, compute mean return and probability of positive return

**Step 5: Rolling Volatility**
- Compute rolling 5-day trailing standard deviation using sample formula (ddof=1)
- Identify maximum volatility value and its corresponding date

**Step 6: Correlation Analysis**
- Compute Pearson correlation between trading volume and absolute daily returns
- Remove any rows with missing values before correlation calculation

**Step 7: Z-Score Analysis**
- Normalize returns using z-scores with population standard deviation (ddof=0)
- Count days where |z-score| > 3

**Step 8: Highest Volume Day**
- Identify the single day with maximum trading volume
- Report its date and corresponding daily return

**Step 9: Most Volatile 10-Day Period**
- For each 10-day consecutive window, compute the mean of the rolling 5-day volatility
- Identify the 10-day window with highest average volatility
- Compute mean daily return for that period

### Python Code

```python
import pandas as pd
import numpy as np

# Load data
df = pd.read_csv("OTS_DS_0335_DOMINOS.csv")

# Convert Date to datetime and filter to 2020
df['Date'] = pd.to_datetime(df['Date'])
df_2020 = df[df['Date'].dt.year == 2020].copy()
df_2020 = df_2020.sort_values('Date').reset_index(drop=True)

# Compute daily percentage returns as decimals
df_2020['Return'] = df_2020['Adj Close'].pct_change()

# Remove first trading day from return calculations
df_returns = df_2020.iloc[1:].copy()

# Step 3: Return distribution statistics
median_return = df_returns['Return'].median()
q1_return = df_returns['Return'].quantile(0.25)
q3_return = df_returns['Return'].quantile(0.75)
iqr_return = q3_return - q1_return

# Identify outliers
lower_bound = q1_return - 1.5 * iqr_return
upper_bound = q3_return + 1.5 * iqr_return
outliers = df_returns[(df_returns['Return'] < lower_bound) | (df_returns['Return'] > upper_bound)]
outlier_count = len(outliers)

# Step 4: Volume analysis
q3_volume = df_2020['Volume'].quantile(0.75)
high_volume_days = df_returns[df_returns['Volume'] > q3_volume]
mean_return_high_vol = high_volume_days['Return'].mean()
prob_positive_high_vol = (high_volume_days['Return'] > 0).mean()

# Step 5: Rolling volatility (sample std, ddof=1)
df_returns['Rolling_Vol'] = df_returns['Return'].rolling(window=5, min_periods=5).std(ddof=1)
max_vol = df_returns['Rolling_Vol'].max()
max_vol_date = df_returns.loc[df_returns['Rolling_Vol'].idxmax(), 'Date']

# Step 6: Correlation
correlation_data = df_returns[['Volume', 'Return']].dropna()
correlation_data['Abs_Return'] = correlation_data['Return'].abs()
correlation = correlation_data['Volume'].corr(correlation_data['Abs_Return'])

# Step 7: Z-score analysis (population std, ddof=0)
mean_ret = df_returns['Return'].mean()
std_ret = df_returns['Return'].std(ddof=0)
df_returns['Z_Score'] = (df_returns['Return'] - mean_ret) / std_ret
extreme_z_count = (df_returns['Z_Score'].abs() > 3).sum()

# Step 8: Highest volume day
highest_vol_idx = df_returns['Volume'].idxmax()
highest_vol_date = df_returns.loc[highest_vol_idx, 'Date']
highest_vol_return = df_returns.loc[highest_vol_idx, 'Return']

# Step 9: Most volatile 10-day period
df_returns['Rolling_Vol_Avg'] = df_returns['Rolling_Vol'].rolling(window=10, min_periods=10).mean()
max_avg_vol_idx = df_returns['Rolling_Vol_Avg'].idxmax()
start_idx = max_avg_vol_idx - 9
end_idx = max_avg_vol_idx
volatile_period = df_returns.iloc[start_idx:end_idx+1]
mean_return_volatile = volatile_period['Return'].mean()

# Format outputs
results = {
    'median_return': round(median_return, 6),
    'q1_return': round(q1_return, 6),
    'q3_return': round(q3_return, 6),
    'iqr_return': round(iqr_return, 6),
    'outlier_count': outlier_count,
    'q3_volume': int(q3_volume),
    'mean_return_high_vol': round(mean_return_high_vol, 6),
    'prob_positive_high_vol': round(prob_positive_high_vol, 6),
    'max_rolling_vol': round(max_vol, 6),
    'max_vol_date': max_vol_date.strftime('%Y-%m-%d'),
    'correlation': round(correlation, 6),
    'extreme_z_count': extreme_z_count,
    'highest_vol_date': highest_vol_date.strftime('%Y-%m-%d'),
    'highest_vol_return': round(highest_vol_return, 6),
    'mean_return_volatile_period': round(mean_return_volatile, 6)
}

print(results)
```

### Ground Truth Final Answer (GTFA)

Based on execution against the actual dataset:

```python
{
    'median_return': 0.000982,
    'q1_return': -0.009999,
    'q3_return': 0.009966,
    'iqr_return': 0.019966,
    'outlier_count': 17,
    'q3_volume': 889500,
    'mean_return_high_vol': -0.000424,
    'prob_positive_high_vol': 0.492063,
    'max_rolling_vol': 0.117244,
    'max_vol_date': '2020-02-26',
    'correlation': 0.333148,
    'extreme_z_count': 3,
    'highest_vol_date': '2020-05-11',
    'highest_vol_return': 0.022689,
    'mean_return_volatile_period': -0.011075
}
```