












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Format (all 3): 25 multiple-select questions, 5 sub-answers each (A-E), blank exam + answer key. Scoring: 1 point per correctly marked/unmarked sub-answer
Typology: Exams
1 / 20
This page cannot be seen from the preview
Don't miss anything!













Summer 2025
CS 7646 Machine Learning for Trading
EXAM QUESTIONS
A. Moving average crossover strategies that rely only on past price patterns. B. Momentum trading using only historical price and volume data. C. Fundamental analysis based on publicly available earnings reports. D. Strategies using private insider information about upcoming mergers. E. Any strategy based solely on technical analysis of price charts.
A. Annualized vol A = 1.5% * sqrt(252) = ~23.8%. B. Annualized vol B = 2.5% * sqrt(252) = ~39.7%. C. Stock B's annualized volatility is roughly 1.67x Stock A's. D. Annualized volatility = daily volatility * 252 (multiply, not square root). E. Higher volatility always implies lower expected returns.
A. The asset has positive alpha; it outperforms what CAPM predicts for its beta. B. The asset is potentially undervalued relative to its systematic risk. C. The SML plots expected return vs. beta (systematic risk only). D. The SML plots expected return vs. total risk (including unsystematic risk). E. An asset above the SML has negative alpha and is overvalued.
EXAM QUESTIONS (cont.)
A. Rising prices force short sellers to buy back shares to cover, which pushes prices even higher. B. Heavily shorted stocks are most vulnerable because many sellers may need to cover simultaneously. C. Margin calls can force short sellers to close positions even if they want to hold. D. Short squeezes only happen to stocks with low short interest. E. Short sellers can hold indefinitely without any risk of forced liquidation.
A. The trailing stop adjusts upward to 5% below $120 = $114. B. If the stock drops from $120 to $114, the stop triggers and a market sell order is placed. C. Trailing stops help lock in gains during uptrends. D. The stop stays at $95 (5% below the original $100) regardless of how high the price goes. E. A trailing stop guarantees you sell at exactly $114.
A. The stock price becomes $5 * 4 = $20. B. Shares outstanding become 40M / 4 = 10M. C. Historical adjusted prices increase by 4x to maintain consistent returns. D. The total market cap changes because of the reverse split. E. Reverse splits increase the total number of shares outstanding.
EXAM QUESTIONS (cont.)
A. Basic slicing creates a view: modifying the slice modifies the original array. B. Fancy indexing creates a copy: modifying the result does not affect the original. C. Understanding views vs. copies prevents subtle bugs in data processing pipelines. D. np.copy(a) creates a view, not an independent copy. E. All NumPy operations always create independent copies in memory.
A. Daily returns: df['price'].pct_change() or df / df.shift(1) - 1. B. 20-day rolling mean: df['returns'].rolling(20).mean(). C. DatetimeIndex enables natural time-based slicing like df['2024-01':'2024-06']. D. df.shift(1) moves data backward in time, not forward. E. Pandas cannot compute rolling statistics on time series data.
A. Look-ahead bias: backward fill uses future prices to fill past gaps. B. Your model might appear to predict future prices but is actually leaking future information. C. Forward-fill first is safer because it only uses past information available at each point. D. The order of fill operations doesn't matter for model training. E. Backward fill is always safe because it only uses neighboring values.
EXAM QUESTIONS (cont.)
A. Smaller leaf_size = more complex tree = lower bias but higher variance. B. Larger leaf_size = simpler tree = higher bias but lower variance. C. leaf_size=1 means each leaf can contain a single sample, maximizing overfitting risk. D. Increasing leaf_size always worsens both training and test performance. E. Decision trees require feature scaling to properly select split points.
A. sqrt(p) = sqrt(20) ~ 4-5 features per split (common heuristic for regression). B. This random feature restriction decorrelates the trees, improving the ensemble. C. Each tree also trains on a different bootstrap sample of the data. D. Each split considers all 20 features, not a random subset. E. Random Forests cannot work with more than 10 features.
A. Shallow trees (stumps or depth 2-3) act as weak learners that slowly correct errors. B. Using deep trees in boosting leads to severe overfitting because each tree tries to fix all remaining errors at once. C. XGBoost and LightGBM are popular gradient boosting implementations. D. Boosting always prevents overfitting regardless of tree depth or number of rounds. E. Boosting models are trained in parallel, not sequentially.
EXAM QUESTIONS (cont.)
A. The posterior shifts strongly toward P(heads)=0.9 due to overwhelming data evidence. B. The likelihood P(D|theta) heavily favors theta near 0.9 given 90/100 heads. C. With less data (e.g., 9 heads in 10 flips), the prior would have more influence on the posterior. D. The prior completely overrides the data, so the posterior remains at 0.5. E. P(D|theta) is the posterior probability, not the likelihood.
A. The model is worse than simply predicting the mean of the target variable. B. Negative R-squared means SS_residual > SS_total: the model's errors exceed total variance. C. This can happen when the model overfits training data and fails on new data. D. Negative R-squared is mathematically impossible. E. Negative R-squared means the model is performing well but in the opposite direction.
A. RMSE penalizes large errors more due to squaring, so a few big errors inflate it. B. The gap suggests the presence of some large outlier errors in the predictions. C. RMSE is in the same units as the target variable, making it interpretable. D. MAE penalizes large errors more heavily than RMSE. E. Lower RMSE always means the model will be profitable for live trading.
EXAM QUESTIONS (cont.)
A. When the market regime changes over time (non-stationarity) and old data becomes irrelevant. B. Walk-forward discards old data, focusing the model on the most recent patterns. C. Expanding window is better when you believe historical patterns remain relevant indefinitely. D. Walk-forward uses future data in the training window. E. Random shuffling is better than both methods for financial time series.
Answers follow on the next pages
ANSWER KEY (cont.)
A. Negative correlation means when one asset falls, the other tends to rise, reducing overall variance. B. Portfolio variance formula includes covariance terms: s_p^2 = Sum(w_i * w_j * s_ij). C. Diversification can eliminate unsystematic risk but not systematic risk. D. Two perfectly correlated assets provide the same diversification benefit as negatively correlated ones. E. Portfolio variance depends only on individual asset variances, not covariances.
A. Year-end AUM = $200M * 1.20 = $240M. B. Performance fee applies only to gains above the high-water mark: $240M - $220M = $20M taxable. C. Performance fee = 20% * $20M = $4M (not 20% of total $40M profit). D. The fund collects 20% * $40M = $8M because the high-water mark is irrelevant. E. The high-water mark resets to zero at the beginning of each year.
A. The order immediately executes against the best ask at $50.10 (or possibly worse if size exceeds that level). B. Market orders guarantee execution but not the exact price. C. A limit buy at $50.00 would NOT execute because the ask is $50.10. D. The market buy order matches against the bid side at $49.90. E. Market orders are held in the book until a matching limit order arrives.
ANSWER KEY (cont.)
A. Rising prices force short sellers to buy back shares to cover, which pushes prices even higher. B. Heavily shorted stocks are most vulnerable because many sellers may need to cover simultaneously. C. Margin calls can force short sellers to close positions even if they want to hold. D. Short squeezes only happen to stocks with low short interest. E. Short sellers can hold indefinitely without any risk of forced liquidation.
A. The trailing stop adjusts upward to 5% below $120 = $114. B. If the stock drops from $120 to $114, the stop triggers and a market sell order is placed. C. Trailing stops help lock in gains during uptrends. D. The stop stays at $95 (5% below the original $100) regardless of how high the price goes. E. A trailing stop guarantees you sell at exactly $114.
A. The stock price becomes $5 * 4 = $20. B. Shares outstanding become 40M / 4 = 10M. C. Historical adjusted prices increase by 4x to maintain consistent returns. D. The total market cap changes because of the reverse split. E. Reverse splits increase the total number of shares outstanding.
ANSWER KEY (cont.)
A. alpha = 2/(9+1) = 0.2, meaning the most recent price gets 20% weight. B. EMA reacts faster to price changes than SMA because it overweights recent data. C. Larger N makes alpha smaller, producing a smoother, more lagged EMA. D. SMA and EMA always produce identical values for the same window. E. EMA with large N is more responsive to sudden price changes than small N.
A. Heteroscedasticity means the variance of residuals is not constant across predictions. B. OLS assumes errors are homoscedastic (constant variance) and independently distributed. C. Violating this assumption can make standard errors unreliable. D. OLS has no assumptions about error distributions whatsoever. E. Adding highly multicollinear features improves OLS estimates.
A. The global mean of all training target values, regardless of the query point. B. This has the highest possible bias and lowest possible variance for KNN. C. It is the opposite extreme of K=1, which memorizes every individual point. D. K=N produces the most flexible, adaptive predictions. E. K=N gives different predictions for each query based on local patterns.
ANSWER KEY (cont.)
A. Smaller leaf_size = more complex tree = lower bias but higher variance. B. Larger leaf_size = simpler tree = higher bias but lower variance. C. leaf_size=1 means each leaf can contain a single sample, maximizing overfitting risk. D. Increasing leaf_size always worsens both training and test performance. E. Decision trees require feature scaling to properly select split points.
A. sqrt(p) = sqrt(20) ~ 4-5 features per split (common heuristic for regression). B. This random feature restriction decorrelates the trees, improving the ensemble. C. Each tree also trains on a different bootstrap sample of the data. D. Each split considers all 20 features, not a random subset. E. Random Forests cannot work with more than 10 features.
A. Shallow trees (stumps or depth 2-3) act as weak learners that slowly correct errors. B. Using deep trees in boosting leads to severe overfitting because each tree tries to fix all remaining errors at once. C. XGBoost and LightGBM are popular gradient boosting implementations. D. Boosting always prevents overfitting regardless of tree depth or number of rounds. E. Boosting models are trained in parallel, not sequentially.
ANSWER KEY (cont.)
A. Regularization (L1/L2) to penalize overly complex models. B. Increasing training data size to give the model more examples. C. Reducing model complexity (e.g., fewer features, larger leaf_size, lower tree depth). D. Adding more features to the model to increase its training R-squared even further. E. Removing the test set and evaluating only on training data.
A. Random shuffling breaks temporal order, leaking future data into training folds. B. Financial data is non-stationary, so training and test periods must be chronological. C. Time-series CV ensures the test fold always comes after the training period. D. Random shuffling is the recommended approach for all types of financial data. E. Temporal order doesn't matter because stock prices are independent across time.
A. Small datasets increase the risk of overfitting, especially with complex models. B. Low signal-to-noise ratio means most patterns are noise, not true signal. C. Simple models often outperform complex ones in finance for exactly this reason. D. 252 days per year provides more than enough data for any ML model to learn reliably. E. Non-stationarity means statistical properties stay constant, making prediction easy.
ANSWER KEY (cont.)
A. When the market regime changes over time (non-stationarity) and old data becomes irrelevant. B. Walk-forward discards old data, focusing the model on the most recent patterns. C. Expanding window is better when you believe historical patterns remain relevant indefinitely. D. Walk-forward uses future data in the training window. E. Random shuffling is better than both methods for financial time series.