# Tỷ suất sinh lợi logarit (Log-Return)


Khi phân tích biến động giá của một tài sản tài chính (ví dụ: cổ phiếu), thay vì sử dụng giá thô $P_t$, các nhà phân tích thường chuyển sang **tỷ suất sinh lợi** (return) để có một chuỗi dữ liệu độc lập với quy mô giá. Có hai loại tỷ suất sinh lợi chính: tỷ suất sinh lợi đơn giản (simple return) và {{< gls "tỷ suất sinh lợi logarit" >}} (log-return).

## Định nghĩa

Tỷ suất sinh lợi logarit $r_t$ tại thời điểm $t$ được định nghĩa là logarit tự nhiên của tỷ số giá giữa hai thời điểm liên tiếp:
$$ r_t = \ln\left(\frac{P_t}{P_{t-1}}\right) = \ln(P_t) - \ln(P_{t-1}) $$

Trong khi đó, tỷ suất sinh lợi đơn giản $R_t$ là:
$$ R_t = \frac{P_t - P_{t-1}}{P_{t-1}} = \frac{P_t}{P_{t-1}} - 1 $$

Khi sự thay đổi giá giữa hai thời điểm là rất nhỏ ($P_t \approx P_{t-1}$), theo khai triển Taylor của hàm $\ln(1+x)$, ta có $r_t \approx R_t$.

## Tại sao Log-Return được ưa chuộng?

1. **"Cộng tính" theo thời gian (Time Additivity)**: 
   Đây là ưu điểm toán học lớn nhất của log-return. Tỷ suất sinh lợi logarit qua $k$ thời kỳ đơn giản là tổng các tỷ suất sinh lợi logarit của từng thời kỳ:
   $$ r_{0,k} = \ln\left(\frac{P_k}{P_0}\right) = \sum_{t=1}^k \ln\left(\frac{P_t}{P_{t-1}}\right) = \sum_{t=1}^k r_t $$
   Tính chất này đặc biệt hữu ích khi tính toán và mô phỏng chuỗi thời gian, vì tổng của các biến ngẫu nhiên thường dễ phân tích (như thông qua Định lý Giới hạn Trung tâm) hơn là tích của chúng (như trong trường hợp tỷ suất sinh lợi đơn giản).

> **⚠️ Simple Return (Bẫy tâm lý):** Qua các bước tính trong mô phỏng dưới đây, bạn có thể thấy tỷ lệ phần trăm tăng luôn trông "lớn hơn" tỷ lệ giảm tương ứng. Việc cộng dồn chúng sẽ tạo ra ảo giác sinh lời giả tạo, khác xa thực tế.

<div class="interactive-pane">
<div style="background: #fdfdfd; padding: 20px; border-radius: 8px; border: 1px solid #ddd; margin-top: 15px;">
<h3 style="margin-top:0; color: #2c3e50; text-align: center;">Trình mô phỏng: Cuộc chạy đua qua 3 ngày</h3>
<p style="color: #666; font-size: 0.9em; text-align: center;">Bấm nút để giả lập giá trong 3 ngày và xem cách tính chi tiết từng bước.</p>
<div style="display: flex; justify-content: center; margin-bottom: 20px;">
<button id="btn-simulate" style="padding: 10px 20px; background: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold;">Tạo ngẫu nhiên giá 3 ngày</button>
</div>
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
<!-- Left Column: Steps -->
<div style="flex: 1; min-width: 300px; background: #fff; padding: 15px; border: 1px solid #eee; border-radius: 6px;">
<h4 style="margin-top: 0; margin-bottom: 15px; color: #333; border-bottom: 2px solid #007bff; padding-bottom: 5px;">Bảng tính chi tiết</h4>
<div id="calc-steps" style="font-size: 0.95em; line-height: 1.6; color: #444;">
Đang chờ dữ liệu...
</div>
</div>
<!-- Right Column: Graph & Conclusion -->
<div style="flex: 1.2; min-width: 300px; display: flex; flex-direction: column; gap: 15px;">
<canvas id="price-canvas" width="400" height="250" style="width: 100%; background: #fff; border: 1px solid #eee; border-radius: 4px;"></canvas>
<div style="display: flex; gap: 10px;">
<div style="flex: 1; background: #ffe3e3; padding: 10px; border-radius: 4px; border: 1px solid #ffc9c9; text-align: center;">
<strong>Tổng Simple Return:</strong><br>
<span id="sum-simple" style="color: #c92a2a; font-weight: bold; font-size: 1.2em;">0%</span><br>
<span style="font-size: 0.8em; color: #555;">(Cộng dồn gây sai số!)</span>
</div>
<div style="flex: 1; background: #d3f9d8; padding: 10px; border-radius: 4px; border: 1px solid #b2f2bb; text-align: center;">
<strong>Tổng Log Return:</strong><br>
<span id="sum-log" style="color: #2b8a3e; font-weight: bold; font-size: 1.2em;">0%</span><br>
<span style="font-size: 0.8em; color: #555;">(Chính xác hoàn toàn)</span>
</div>
</div>
<div style="text-align: center; font-size: 1.05em; background: #e7f5ff; padding: 10px; border-radius: 4px;">
Tăng trưởng thực tế: <strong id="actual-change" style="color: #1971c2;">0%</strong>
</div>
</div>
</div>
</div>
</div>

2. **Tính đối xứng (Symmetry)**:
   Nếu giá tăng từ 100 lên 200, tỷ suất sinh lợi đơn giản là $+100\%$. Nếu giá giảm ngược lại từ 200 về 100, tỷ suất sinh lợi đơn giản là $-50\%$. Sự bất đối xứng này gây nhầm lẫn. 
   Tuy nhiên, với log-return:
   $$ \ln(200/100) \approx +69.3\% \quad \text{và} \quad \ln(100/200) \approx -69.3\% $$
   Sự tăng và giảm giá ngược chiều nhau triệt tiêu nhau một cách hoàn hảo.

<div class="interactive-pane">
<div style="background: #fdfdfd; padding: 20px; border-radius: 8px; border: 1px solid #ddd; margin-top: 15px;">
<h3 style="margin-top:0; color: #2c3e50; text-align: center;">Cái bẫy của Tỷ suất sinh lợi đơn giản</h3>
<p style="color: #666; font-size: 0.9em; text-align: center;">Kéo thanh trượt để thay đổi giá ngày 1. Quan sát tổng lợi suất sau khi giá quay về mốc cũ (100$).</p>
<div style="display: flex; justify-content: center; align-items: center; margin-bottom: 20px;">
<label style="font-weight: bold; margin-right: 15px;">Giá ngày 1 (Tăng): <span id="val-price1" style="color: #007bff; font-size: 1.2em;">200$</span></label>
<input type="range" id="slider-price" min="110" max="300" value="200" step="10" style="width: 200px;">
</div>
<div style="display: flex; justify-content: space-between; text-align: center; margin-bottom: 20px; font-weight: bold;">
<div style="width: 30%;">Ngày 0<br><span style="font-size: 1.5em; color: #333;">100$</span></div>
<div style="width: 30%; position: relative;">Ngày 1<br><span id="display-price1" style="font-size: 1.5em; color: #007bff;">200$</span></div>
<div style="width: 30%;">Ngày 2<br><span style="font-size: 1.5em; color: #333;">100$</span></div>
</div>
<!-- Thanh so sánh -->
<div style="display: flex; flex-direction: column; gap: 15px;">
<div style="border: 1px solid #ffc9c9; border-radius: 4px; overflow: hidden;">
<div style="background: #ffe3e3; padding: 5px 10px; font-weight: bold; color: #c92a2a; border-bottom: 1px solid #ffc9c9;">Simple Return (Bẫy tâm lý)</div>
<div style="display: flex; padding: 10px; justify-content: space-around;">
<div>Tăng: <span id="simple-up" style="color: #2b8a3e; font-weight: bold;">+100.0%</span></div>
<div>Giảm: <span id="simple-down" style="color: #c92a2a; font-weight: bold;">-50.0%</span></div>
<div style="border-left: 2px dashed #ffc9c9; padding-left: 10px;">Tổng: <span id="simple-sum" style="color: #c92a2a; font-weight: bold; font-size: 1.2em;">+50.0%</span> (Ảo giác)</div>
</div>
</div>
<div style="border: 1px solid #b2f2bb; border-radius: 4px; overflow: hidden;">
<div style="background: #d3f9d8; padding: 5px 10px; font-weight: bold; color: #2b8a3e; border-bottom: 1px solid #b2f2bb;">Log Return (Trung thực)</div>
<div style="display: flex; padding: 10px; justify-content: space-around;">
<div>Tăng: <span id="log-up" style="color: #2b8a3e; font-weight: bold;">+69.3%</span></div>
<div>Giảm: <span id="log-down" style="color: #c92a2a; font-weight: bold;">-69.3%</span></div>
<div style="border-left: 2px dashed #b2f2bb; padding-left: 10px;">Tổng: <span id="log-sum" style="color: #2b8a3e; font-weight: bold; font-size: 1.2em;">0.0%</span> (Chuẩn xác)</div>
</div>
</div>
</div>
</div>
</div>

<script src="/js/log-return-interactive.js"></script>

3. **Liên hệ với mô hình thời gian liên tục**:
   Trong các mô hình tài chính như Chuyển động Brown Hình học (Geometric Brownian Motion - GBM) thường được dùng trong định giá quyền chọn Black-Scholes, giá tài sản có dạng hàm mũ. Khi đó, log-return tuân theo một phân phối chuẩn với các tham số tỷ lệ thuận trực tiếp với thời gian.

## Hạn chế
Mặc dù log-return có "cộng tính" theo thời gian, nó lại **không có "cộng tính" theo không gian** (cross-sectional additivity). Lợi suất logarit của một danh mục đầu tư không bằng tổng gia quyền lợi suất logarit của các tài sản thành phần. Đối với các bài toán tối ưu hóa danh mục tĩnh, tỷ suất sinh lợi đơn giản thường được sử dụng. Tùy vào giả thiết và bài toán cụ thể mà việc chọn loại lợi suất nào sẽ phù hợp hơn.

