When I started working on this project 6 months ago, I had a straightforward goal: figure out the optimal mix of wind and solar generation for a hypothetical 100 MW renewable energy portfolio in the ERCOT market. What seemed like a textbook application of Modern Portfolio Theory turned into a deep dive into electricity market dynamics, volatility modeling, and the humbling experience of debugging my own assumptions.
Why This Problem Matters
The renewable energy sector faces a unique challenge. Unlike traditional power plants that can control their output, wind and solar generators are at the mercy of weather patterns. At the same time, electricity prices in markets like ERCOT can swing wildly. Sometimes by orders of magnitude within hours. This creates a double-sided risk: you don’t know how much you’ll produce, and you don’t know what price you’ll get for it.
For investors and operators in this space, the question isn’t just “should we build wind or solar?”. Rather, it is “what combination maximizes our risk-adjusted returns?” This is where portfolio optimization comes in, and it’s precisely the kind of problem that sits at the intersection of quantitative finance and energy markets.
The Approach: Five Phases
I structured the analysis into five phases, each building on the previous one.
Phase 1: Understanding the Market
Before optimizing anything, I needed to understand how the ERCOT market actually behaves. I simulated two years of hourly electricity prices based on typical patterns: strong volatility clustering (periods of calm followed by sharp spikes), clear seasonality (summer peaks for air conditioning demand), and the occasional price spike that makes risk management critical.
The generation profiles were equally important. Wind capacity factors in West Texas average around 35 percent, with stronger output during evening hours and winter months. Solar, predictably, peaks at noon with a 25 percent average capacity factor but produces nothing at night. That negative correlation between the two resources seemed promising for diversification.
Phase 2: Forecasting Prices and Volatility
This is where my master’s thesis work on GARCH models became directly applicable. I built three forecasting approaches:
- An ARIMA model to capture trend and seasonality
- A GARCH(1,1) model to forecast volatility (because electricity prices exhibit strong conditional heteroskedasticity)
- A Random Forest model with engineered features like hour-of-day, temperature, and rolling volatility windows
The Random Forest performed best on out-of-sample data, but the GARCH model was invaluable for understanding risk. The persistence parameter was 0.89, meaning volatility shocks decay slowly. This is exactly what you’d expect in an energy market where supply-demand imbalances can persist.
Phase 3: Modeling Renewable Generation
I used Monte Carlo simulation to generate 1,000 scenarios for both wind and solar output, incorporating weather uncertainty. The key insight here was that while wind and solar have near-zero correlation, they complement each other temporally. Solar captures high daytime prices when demand peaks, while wind provides more stable baseload generation.
Phase 4: Portfolio Optimization
This is where Modern Portfolio Theory met energy economics. I calculated the efficient frontier—the set of portfolios that offer the highest expected return for each level of risk—using mean-variance optimization with constraints.

The visualization above tells the complete story. The efficient frontier (top left) shows the classic upward-sloping curve. Every point represents a portfolio that maximizes return for a given level of risk. The optimal portfolio sits at the “knee” of the curve, marked with a red star at 46 percent wind allocation.
What struck me immediately was how 100 percent solar (orange triangle) falls well below the efficient frontier. It’s not just suboptimal, it’s inefficient. You could achieve the same return with significantly less risk by mixing in wind, or achieve higher returns for the same risk level.
The risk reduction chart (bottom left) quantifies the diversification benefit. Starting from 100 percent wind, portfolio risk decreases as you add solar, reaching a minimum around 50 percent allocation, before climbing back up as you approach 100 percent solar. This U-shaped curve is the mathematical proof that diversification works, at least until one asset’s fundamentals start to dominate.
The optimal allocation turned out to be 52 percent wind and 48 percent solar, achieving a Sharpe ratio of 2.12. This was only marginally better than a naive 50-50 split, but the interesting finding was that 100 percent solar was clearly inefficient. Wind’s higher capacity factor and lower volatility made it the dominant asset, even though diversification still added value.
The risk metrics were telling:
- Expected annual revenue: 93,000 dollars per MW
- Revenue volatility: 12,800 dollars per MW (about 14 percent)
- 95th percentile Value at Risk: 79,400 dollars per MW
- Maximum drawdown from backtesting: 17.3 percent
Phase 5: Backtesting and Reality Checks
I validated the strategy on a six-month out-of-sample period. The optimal portfolio outperformed all benchmarks: 100 percent wind, 100 percent solar, and a 50-50 mix—with an out-of-sample Sharpe ratio of 1.92.

The backtesting results confirmed what the optimization suggested. The Sharpe ratio distribution (top panel) shows that the optimal portfolio (teal) consistently achieves ratios in the 2.0 to 2.5 range. That is right where we want to be. Compare this to 100 percent solar (yellow-orange), which has a wider distribution centered around 1.2. The separation between these distributions is statistically significant.
The maximum drawdown analysis (middle left) was particularly informative. The optimal portfolio’s worst drawdowns cluster around 7 to 10 percent, while 100 percent solar regularly experiences drawdowns of 15 to 20 percent. In practical terms, this means the diversified portfolio is less likely to hit financial covenant triggers or require emergency capital injections during bad months.
The sample paths at the bottom show 50 different scenarios of how the portfolio might perform over five years. What’s reassuring is that the mean path (red line) shows steady growth, and even the worst-case scenarios (the lower blue lines) don’t result in catastrophic losses. This is the kind of stability that makes projects financeable.
But this phase also exposed some typical and embarrassing bugs in my initial implementation. My first attempt produced a Sharpe ratio of 176, which should have immediately raised red flags. The problem? I hadn’t properly annualized my volatility calculations. When you’re working with monthly returns, you need to multiply standard deviation by the square root of 12 to get annualized volatility. Miss that step, and your Sharpe ratios become nonsensical.
There was also the NPV problem. My initial economic analysis showed a negative net present value of 71 million dollars, which made no sense for a project that looked attractive on risk-adjusted returns. The issue turned out to be missing revenue streams. I had modeled energy-only revenue but forgotten to include Renewable Energy Credits and Production Tax Credits. These are incentives that are critical to project economics in the U.S. renewable sector. Adding these brought the NPV to positive 22 million dollars.
What the Numbers Actually Mean
Let me translate the financial jargon into practical terms. A Sharpe ratio of 2.12 means that for every unit of risk (volatility) you take, you get 2.12 units of excess return above the risk-free rate. That’s good. Not spectacular, but solidly in the “attractive investment” range.
The 27 percent risk reduction from diversification means your revenue is more stable than if you went all-in on either technology. In practice, this translates to more predictable cash flows, easier financing, and lower probability of default in debt service.
The maximum drawdown of 17 percent represents your worst-case scenario in the historical simulation. In a real portfolio, this would be the deepest you’d be “underwater” relative to your peak value. For context, a 100 percent solar portfolio had a 22 percent maximum drawdown, which is substantially worse.
Lessons Learned
First, always validate your metrics against intuition. A Sharpe ratio above 3 in energy markets should make you suspicious.
Second, renewable energy economics are heavily policy-dependent. The difference between a viable and unviable project often comes down to tax credits and renewable energy certificates. This is a fundamental business risk that any analyst in this sector needs to understand.
Third, theoretical diversification benefits depend on both correlation and the relative quality of the assets. Wind and solar had essentially zero correlation, which is ideal for diversification. But wind also had better fundamentals (higher capacity factor, lower volatility), so the optimal portfolio tilted in that direction.
Finally, backtesting is non-negotiable. My in-sample Sharpe ratio was 2.12; out-of-sample was 1.92. That 10 percent degradation is normal and acceptable. It means the model generalizes reasonably well. But if I hadn’t tested on holdout data, I wouldn’t know whether I was overfitting.
The Bigger Picture
This project started as a portfolio optimization exercise. However, it evolved into something more interesting: a case study in how quantitative methods from finance can be applied to energy markets, and where the analogy breaks down.
Unlike financial assets, renewable energy projects have physical constraints. You can’t short solar generation. You can’t leverage your wind farm. Your “returns” depend on weather patterns that, while modelable, are ultimately stochastic in ways that stock prices aren’t.
At the same time, the fundamental toolkit, i.e. mean-variance optimization, GARCH models, Monte Carlo simulation, translates remarkably well. The key is understanding the domain-specific nuances: capacity factors, time-of-day pricing patterns, the role of policy incentives, and the operational realities of energy markets.
Code and Reproducibility
The complete project is available on GitHub, with five Jupyter notebooks walking through each phase of the analysis. All code is documented, all assumptions are explicit, and all results are reproducible. I’ve included the corrected versions of the notebooks with proper time scaling and complete economic modeling.
If you’re interested in energy markets, quantitative finance, or just want to see how Modern Portfolio Theory applies outside traditional asset classes, the repository includes everything you need to replicate or extend the analysis.
What’s Next
There are several directions this work could go. Adding battery storage would introduce an optimization problem with a third dimension: when to store versus when to sell. Geographic diversification across multiple sites would reduce local weather risk. Including transmission congestion would add another layer of realism to the pricing model.
But for now, I’m satisfied that this project demonstrates the core skills: formulating the problem, implementing the models correctly, validating the results, and being honest about the bugs along the way.
And that’s what quantitative analysis really is: understanding when models are wrong and having the discipline to fix them.






Leave a Reply