Bitget App
Trade smarter
Buy cryptoMarketsTradeFuturesEarnSquareMore
daily_trading_volume_value
market_share59.86%
Current ETH GAS: 0.1-1 gwei
Hot BTC ETF: IBIT
Bitcoin Rainbow Chart : Accumulate
Bitcoin halving: 4th in 2024, 5th in 2028
BTC/USDT$ (0.00%)
banner.title:0(index.bitcoin)
coin_price.total_bitcoin_net_flow_value0
new_userclaim_now
download_appdownload_now
daily_trading_volume_value
market_share59.86%
Current ETH GAS: 0.1-1 gwei
Hot BTC ETF: IBIT
Bitcoin Rainbow Chart : Accumulate
Bitcoin halving: 4th in 2024, 5th in 2028
BTC/USDT$ (0.00%)
banner.title:0(index.bitcoin)
coin_price.total_bitcoin_net_flow_value0
new_userclaim_now
download_appdownload_now
daily_trading_volume_value
market_share59.86%
Current ETH GAS: 0.1-1 gwei
Hot BTC ETF: IBIT
Bitcoin Rainbow Chart : Accumulate
Bitcoin halving: 4th in 2024, 5th in 2028
BTC/USDT$ (0.00%)
banner.title:0(index.bitcoin)
coin_price.total_bitcoin_net_flow_value0
new_userclaim_now
download_appdownload_now
a portfolio is composed of two stocks a and b

a portfolio is composed of two stocks a and b

This article explains what it means when a portfolio is composed of two stocks A and B, covering weights, expected return, variance, covariance vs correlation, diversification cases, closed-form op...
2025-12-19 16:00:00
share
Article rating
4.4
102 ratings

Portfolio composed of two stocks A and B

This page explains how a portfolio is composed of two stocks A and B, why the two-asset model is the foundational building block in portfolio theory, and how to compute returns, risk, and optimal weights in practice.

As an opening note: a portfolio is composed of two stocks A and B in the simplest mean–variance setting means the portfolio return is the weighted combination of two risky assets and the portfolio risk depends on individual variances plus their covariance. In the sections that follow you will find definitions, formulas, worked numerical examples, optimization closed forms (including the global minimum-variance portfolio), practical estimation advice, and templates you can reuse when assessing a pair of stocks, ETFs, or crypto tokens. Repeatedly using the simple two-asset case helps make intuition about diversification, correlation, and the efficient frontier concrete.

As of 2024-06-01, according to academic course materials and market-data summaries used by teaching programs, the two-asset model remains the canonical introductory example in modern portfolio theory and continues to be used in practitioner diagnostics for pair trading and portfolio construction.

Overview

Studying how a portfolio is composed of two stocks A and B reveals how expected return depends linearly on weights while risk (variance) is a quadratic function of weights and the assets' joint behavior. The two-asset analysis shows when diversification reduces volatility, when it cannot, and how correlation shifts achievable risk–return combinations. The full set of achievable mean–variance points for two risky assets is a curve (a segment of a parabola) that connects the asset endpoints in mean–variance space and helps illustrate the efficient frontier and tangency portfolio when a risk-free asset is present.

Basic definitions and notation

  • We consider two risky assets, labeled A and B. The phrase "a portfolio is composed of two stocks A and B" means the portfolio return is a weighted sum of the two asset returns.
  • Weights: w_A and w_B are portfolio weights on asset A and B, respectively. In a fully invested portfolio without leverage we have w_A + w_B = 1. If leverage or cash exists the sum may differ from 1.
  • Individual returns (random variables): R_A and R_B denote the period returns of A and B.
  • Expected returns: μ_A = E[R_A], μ_B = E[R_B].
  • Variances: σ_A^2 = Var(R_A), σ_B^2 = Var(R_B).
  • Covariance: Cov(R_A, R_B) = σ_{AB}.
  • Correlation: ρ_{AB} = Corr(R_A, R_B) = σ_{AB} / (σ_A σ_B).

When we say "a portfolio is composed of two stocks A and B," we often assume the returns, means, variances, and covariance are known or estimated from data and then used in formulas below.

Portfolio expected return

Linearity of expectation gives a direct formula for the portfolio expected return: if portfolio return R_p = w_A R_A + w_B R_B then

  • E[R_p] = w_A μ_A + w_B μ_B.

This linearity implies attribution is straightforward: each weight multiplies its asset's expected return contribution. When a portfolio is composed of two stocks A and B the portfolio expected return moves linearly as you increase one weight and decrease the other.

Portfolio variance and standard deviation

Portfolio variance depends on the weights, individual variances, and covariance:

  • Var(R_p) = w_A^2 σ_A^2 + w_B^2 σ_B^2 + 2 w_A w_B σ_{AB}.

Equivalently, using correlation:

  • Var(R_p) = w_A^2 σ_A^2 + w_B^2 σ_B^2 + 2 w_A w_B ρ_{AB} σ_A σ_B.

The portfolio standard deviation is the square root of the variance: σ_p = sqrt(Var(R_p)).

Interpretation: covariance (or correlation) determines how much the assets move together; lower (or negative) correlation increases the diversification benefit and reduces portfolio variance for given weights.

Covariance vs correlation

  • Covariance σ_{AB} = E[(R_A - μ_A)(R_B - μ_B)]. It has units of return^2 and depends on scale (if returns measured in percent vs decimal, covariance scales accordingly).
  • Correlation ρ_{AB} = σ_{AB} / (σ_A σ_B) is dimensionless and bounded between -1 and 1. It is scale-free and therefore easier to interpret when comparing relationships across assets.

Interpretation of ρ:

  • ρ = 1: perfect positive correlation — no diversification benefit beyond weighted average volatility.
  • ρ = 0: uncorrelated returns — some diversification benefit (cross-term drops out).
  • ρ = -1: perfect negative correlation — for appropriate weights, volatility can be fully eliminated (in the absence of estimation error).

Special cases and diversification effects

When analyzing how a portfolio is composed of two stocks A and B, inspect correlation cases:

  • ρ_{AB} = 1 (perfect positive correlation): Var(R_p) = (w_A σ_A + w_B σ_B)^2. The portfolio behaves as a scaled single risk factor; diversification does not reduce risk beyond simple averaging.
  • ρ_{AB} = 0 (zero correlation): Var(R_p) = w_A^2 σ_A^2 + w_B^2 σ_B^2. The cross-term vanishes and variance is the sum of weighted variances.
  • ρ_{AB} = -1 (perfect negative correlation): There exists a weight choice that yields Var(R_p) = 0: choose w_A σ_A = w_B σ_B (with sign allowance) to cancel volatility. This is an idealized case rarely observed in real markets.

For fixed w_A and w_B, reducing ρ_{AB} lowers Var(R_p) monotonically. Thus, when a portfolio is composed of two stocks A and B, selecting assets with low or negative correlation is the principal route to risk reduction via diversification.

Solving for unknown correlation or covariance (practical algebraic use)

If you observe portfolio variance Var(R_p) and know w_A, w_B, σ_A, and σ_B, you can solve for σ_{AB} or ρ_{AB} by rearranging the variance formula:

  • σ_{AB} = [Var(R_p) - w_A^2 σ_A^2 - w_B^2 σ_B^2] / (2 w_A w_B).
  • ρ_{AB} = σ_{AB} / (σ_A σ_B).

This is useful in diagnostic problems where you have an empirical portfolio variance and wish to back out the implied covariance/correlation.

Numerical examples

Below are short worked examples applying the canonical formulas. Each example assumes a portfolio is composed of two stocks A and B and shows the algebra.

Example 1 — compute expected return

  • Suppose μ_A = 8% (0.08), μ_B = 12% (0.12), and weights w_A = 0.6, w_B = 0.4 (w_A + w_B = 1).

  • E[R_p] = 0.6 × 0.08 + 0.4 × 0.12 = 0.048 + 0.048 = 0.096 = 9.6%.

When a portfolio is composed of two stocks A and B, expected return is a simple weighted average of the assets' expected returns.

Example 2 — compute portfolio variance for given correlation

  • Let σ_A = 15% (0.15), σ_B = 25% (0.25), weights w_A = 0.6, w_B = 0.4, and ρ_{AB} = 0.2.

  • Var(R_p) = 0.6^2 × 0.15^2 + 0.4^2 × 0.25^2 + 2 × 0.6 × 0.4 × 0.2 × 0.15 × 0.25.

Compute numerically:

  • Term1 = 0.36 × 0.0225 = 0.0081
  • Term2 = 0.16 × 0.0625 = 0.01
  • Cross-term = 2 × 0.24 × 0.2 × 0.0375 = 0.0036
  • Var(R_p) = 0.0081 + 0.01 + 0.0036 = 0.0217
  • σ_p = sqrt(0.0217) ≈ 14.73%.

This shows a portfolio composed of two stocks A and B with moderate correlation attains a standard deviation lower than the weighted average of individual volatilities.

Example 3 — solve for implied correlation

  • Suppose observed σ_p = 10% (0.10), σ_A = 8% (0.08), σ_B = 12% (0.12), weights w_A = 0.5, w_B = 0.5.

  • Var(R_p) = 0.01. Plug into formula to solve for ρ_{AB}:

Var(R_p) = 0.5^2 × 0.08^2 + 0.5^2 × 0.12^2 + 2 × 0.5 × 0.5 × ρ × 0.08 × 0.12.

Compute terms:

  • 0.25 × 0.0064 = 0.0016
  • 0.25 × 0.0144 = 0.0036
  • Sum of squares = 0.0052

Then 0.01 - 0.0052 = 0.0048 = 2 × 0.25 × ρ × 0.0096 = 0.5 × ρ × 0.0096.

Therefore ρ = 0.0048 / (0.5 × 0.0096) = 0.0048 / 0.0048 = 1.

Interpretation: the implied correlation is 1, meaning no diversification in this particular numeric example.

Example 4 — extreme negative correlation elimination

  • If σ_A = 10%, σ_B = 15% and ρ = -1, choose weights so that w_A σ_A = w_B σ_B with w_A + w_B = 1. Solve w_A (0.10) = (1 - w_A) (0.15) ⇒ 0.10 w_A = 0.15 - 0.15 w_A ⇒ 0.25 w_A = 0.15 ⇒ w_A = 0.6.

  • Then w_B = 0.4 and Var(R_p) = 0. Hence, when a portfolio is composed of two stocks A and B with perfect negative correlation, theoretical zero volatility is possible.

Two-asset portfolio optimization

The two-asset case allows closed-form solutions for standard optimization problems in mean–variance analysis. Two primary objectives are often considered:

  1. Minimize variance for a given expected return.
  2. Maximize expected return for a given level of risk (or maximize Sharpe ratio when a risk-free asset is present).

Because only two weights exist and they sum to one (in the fully invested case), algebra reduces optimization to simple one-dimensional calculus or closed-form linear algebra.

Global minimum-variance portfolio (GMVP)

The global minimum-variance portfolio minimizes Var(R_p) across all weight choices (no return constraint). For two assets, with unconstrained weights (allowing shorting), the weight on A that minimizes variance is:

  • w_A^* = (σ_B^2 - σ_{AB}) / (σ_A^2 + σ_B^2 - 2 σ_{AB}).

Equivalently, in correlation form:

  • w_A^* = (σ_B^2 - ρ σ_A σ_B) / (σ_A^2 + σ_B^2 - 2 ρ σ_A σ_B).

Then w_B^* = 1 - w_A^*.

Notes:

  • The denominator equals Var(R_A - R_B) and is positive except in degenerate cases (perfect correlation with identical proportional volatilities).
  • If you restrict weights (no short selling), the constrained GMVP will lie on the feasible boundary (either w_A = 0 or w_B = 0) if the unconstrained solution violates the constraints.

Example — GMVP numbers

  • Suppose σ_A = 0.15, σ_B = 0.25, ρ = 0.2.

Compute σ_{AB} = 0.2 × 0.15 × 0.25 = 0.0075.

  • Numerator = σ_B^2 - σ_{AB} = 0.0625 - 0.0075 = 0.055.
  • Denominator = 0.0225 + 0.0625 - 2 × 0.0075 = 0.070.
  • w_A^* = 0.055 / 0.070 ≈ 0.7857. Then w_B^* ≈ 0.2143.

Check: the GMVP heavily favors the lower-volatility asset A because covariance is moderate.

Existence and uniqueness

The GMVP is unique unless the two assets are perfectly collinear in returns (ρ = ±1 with proportional volatilities causing degeneracy). With typical market data (ρ strictly between -1 and 1), the GMVP exists and is unique.

Efficient frontier with two assets

When plotting expected return versus standard deviation for all weight combinations (w_A from -∞ to +∞), the set of achievable (σ_p, E[R_p]) pairs traces a section of a parabola (a conic section) in mean–variance space. For weights constrained to w_A + w_B = 1, the locus is a continuous curve between the two asset endpoints; varying weights beyond [0,1] includes leveraged and short positions and extends the curve beyond the endpoints.

Points on the upper portion of the curve that yield the highest return for a given risk are part of the efficient frontier. For two assets, the efficient frontier portion consists of the upper branch between the tangency points (in the unconstrained mean–variance plane) and is straightforward to compute analytically.

Tangency portfolio and inclusion of a risk-free asset

When a risk-free rate r_f is available, the Capital Allocation Line (CAL) is the straight line from the risk-free point (0, r_f) tangent to the risky-asset frontier. The tangency portfolio maximizes the Sharpe ratio ( (μ_p - r_f)/σ_p ) among risky portfolios.

For a portfolio composed of two stocks A and B, the tangency portfolio corresponds to the point on the two-asset risky set with maximum slope with respect to the σ-axis. The tangency weights can be found by maximizing (w_A μ_A + w_B μ_B - r_f)/sqrt(Var(R_p)) with w_B = 1 - w_A, typically solved numerically or by first-order conditions (closed form exists but is algebraically longer than the GMVP expression).

The practical result: when mixing a risk-free asset with the tangency portfolio, any portfolio along the CAL is a combination (via leverage or de-leveraging) of the risk-free asset and the tangency portfolio.

Practical implementation and estimation

When a portfolio is composed of two stocks A and B in real applications, the inputs μ_A, μ_B, σ_A^2, σ_B^2, and σ_{AB} are estimated from historical data. Estimation choices materially affect optimization outputs.

Key practical points:

  • Return frequency: choose daily, weekly, or monthly returns consistent with investment horizon. Shorter horizons give more observations but more noise; longer horizons reduce noise but fewer datapoints.
  • Sample means are noisy, especially for short histories. Variances and covariances are more stable than means but still subject to sampling error.
  • Use overlapping windows and rolling estimation to track time-varying parameters.
  • Beware look-ahead bias: never use data that would not have been available at decision time.

As of 2024-06-01, practitioners teaching portfolio construction recommend using at least 3–5 years of monthly data or 1–3 years of daily data for variance/covariance estimation for typical equity pairs, but choices depend on turnover, regime changes, and the asset class.

Techniques to improve estimation

To make the two-asset analysis more robust when a portfolio is composed of two stocks A and B, apply one or more of the following:

  • Shrinkage estimators: shrink sample covariance toward a target (e.g., diagonal matrix or single-factor structure) to reduce estimation error.
  • Exponentially weighted moving averages (EWMA): place more weight on recent observations to capture time-varying volatility and correlation.
  • Robust estimators: use robust statistical methods (e.g., median-based variance, winsorized returns) to limit the influence of outliers.
  • Bayesian approaches and factor models: incorporate prior beliefs or use factor-based covariances to stabilize estimates, especially when expanding to many assets.

These techniques reduce the chance that an optimizer will choose extreme allocations based on noisy sample inputs — a frequent problem when building portfolios composed of two stocks A and B from limited data.

Constraints, extensions and special considerations

Real portfolios are subject to constraints and frictions. When a portfolio is composed of two stocks A and B, consider:

  • No short selling: restrict w_A, w_B ≥ 0, which may push GMVP to a corner solution.
  • Weight bounds: impose maximum weight constraints to limit concentration risk.
  • Transaction costs and taxes: frequent rebalancing to maintain target weights can erode returns; include explicit transaction cost models when optimizing.
  • Rebalancing frequency: choose monthly, quarterly, or threshold-based rebalancing to balance drift against trading cost.
  • Leverage: allowing leverage changes feasible points (scales risk and return) but requires margin/collateral and increases tail risk.

Extension to n assets: formulas become matrix algebra (covariance matrix Σ and weight vector w), but intuition from the two-asset case (importance of correlation and diversification) carries over directly.

Applications to equities and crypto

The same math applies whether a portfolio is composed of two stocks A and B, two ETFs, or two crypto tokens, but practical differences matter:

  • Crypto tends to exhibit higher volatility (σ), which raises portfolio variance and the impact of estimation error.
  • Correlations among crypto tokens can change rapidly during events (liquidity shocks, regulatory news), so EWMA or more adaptive estimators may be important.
  • Liquidity constraints and custody considerations are often larger in crypto; when executing trades to rebalance a portfolio composed of two tokens, slippage and on-chain fees can be nontrivial.

If you are using an exchange or custody solution, Bitget and Bitget Wallet provide trading and custody services that integrate order execution for spot, margin, and derivatives (where appropriate). When a portfolio is composed of two tokens and you need a single provider for custody and trading, Bitget is a recommended platform for execution and Bitget Wallet for secure custody and transaction management. Always confirm trading and custody terms and compliance details before trading.

Common pitfalls and limitations

When applying two-asset models remember:

  • Historical estimates may not reflect future distributions (parameter instability).
  • Returns are often non-normal; variance does not capture tail risk or skewness.
  • Correlations are time-varying and may increase in market stress, reducing diversification when it is most needed.
  • Small-sample overfitting: optimization on short windows often produces extreme weights driven by noise.
  • Ignoring transaction costs and taxes can turn theoretically optimal strategies into poor net performers.

These limitations do not invalidate two-asset analysis but emphasize the need for robust estimation, stress testing, and cautious implementation.

Worked problem templates

Below are template steps for common calculations when a portfolio is composed of two stocks A and B. Replace symbols with your data and compute numerically.

  1. Compute portfolio expected return
  • Inputs: w_A, w_B, μ_A, μ_B (ensure w_A + w_B = 1 if fully invested)
  • Formula: E[R_p] = w_A μ_A + w_B μ_B
  • Steps: multiply each weight by asset mean and sum.
  1. Compute portfolio variance
  • Inputs: w_A, w_B, σ_A, σ_B, ρ_{AB} or σ_{AB}
  • Formula: Var(R_p) = w_A^2 σ_A^2 + w_B^2 σ_B^2 + 2 w_A w_B σ_{AB}
  • Steps: compute squared terms, compute covariance term, sum, then take square root for σ_p.
  1. Solve for covariance/correlation given portfolio variance
  • Inputs: Var(R_p), w_A, w_B, σ_A, σ_B
  • Rearranged formula: σ_{AB} = [Var(R_p) - w_A^2 σ_A^2 - w_B^2 σ_B^2] / (2 w_A w_B)
  • Then ρ_{AB} = σ_{AB} / (σ_A σ_B)
  1. Compute GMVP weights
  • Inputs: σ_A^2, σ_B^2, σ_{AB}
  • Formula: w_A^* = (σ_B^2 - σ_{AB}) / (σ_A^2 + σ_B^2 - 2 σ_{AB}), w_B^* = 1 - w_A^*

These templates are quick checks you can run in a spreadsheet or script when a portfolio is composed of two stocks A and B.

See also

  • Modern portfolio theory
  • Efficient frontier
  • Capital Asset Pricing Model (CAPM)
  • Portfolio optimization
  • Covariance matrix estimation
  • Risk parity (conceptual extension)

References and further reading

  • Classic textbooks and course notes on portfolio theory (e.g., Bodie, Kane & Marcus; lecture notes from leading universities noted in finance curricula). These sources provide derivations and extensive examples for two-asset and multi-asset portfolios.
  • Practitioner guides on covariance estimation and shrinkage methods.
  • Investopedia and academic lecture notes for worked numerical examples and basic formulas.

Further reading and course materials are widely available from university lecture pages and standard finance texts for those who want full derivations and proofs.

Final notes and practical next steps

When you evaluate how a portfolio is composed of two stocks A and B in practice, do the following:

  • Estimate means and covariances with an estimation approach appropriate to your horizon (e.g., EWMA for short-horizon trading, longer windows for strategic allocation).
  • Run sensitivity checks: vary correlation and means to see how allocations and risk change.
  • Account for trading costs and rebalancing rules before implementing live trades.

If you are ready to trade or test a live strategy with a portfolio composed of two assets, Bitget provides execution and Bitget Wallet offers custody and transaction tools you can integrate into your workflow. Explore Bitget's interface and wallet features to manage trades, monitor positions, and control rebalancing frequency.

Further explore the worked templates above with your data and remember that numerical outputs are only as reliable as the inputs and assumptions used. Model carefully, estimate robustly, and monitor regimes.

HTML note: below is a short HTML snippet you can embed in dashboards or a documentation site to summarize the key formula quickly.

Key formulas (quick reference)
  • Expected return: E[R_p] = w_A μ_A + w_B μ_B
  • Variance: Var(R_p) = w_A^2 σ_A^2 + w_B^2 σ_B^2 + 2 w_A w_B σ_{AB}
  • Covariance from variance: σ_{AB} = (Var(R_p) - w_A^2 σ_A^2 - w_B^2 σ_B^2) / (2 w_A w_B)
The information above is aggregated from web sources. For professional insights and high-quality content, please visit Bitget Academy.
Buy crypto for $10
Buy now!

Trending assets

Assets with the largest change in unique page views on the Bitget website over the past 24 hours.

Popular cryptocurrencies

A selection of the top 12 cryptocurrencies by market cap.
Up to 6200 USDT and LALIGA merch await new users!
Claim