f8b21af4be
10_Wiki/Topics 대규모 정리: - 오류 캡처/미완성 stub 문서 227개 제거 - 교차폴더 중복 43클러스터 병합 (63파일 → redirect) - 링크명 정규화: 깨진 링크 수정·redirect 직결·개념 매핑 ~2,400건 - 카테고리 MOC 6개 신규 생성 - Graph 섹션 미해결 related-keyword 링크 10,058건 제거 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
207 lines
6.0 KiB
Markdown
207 lines
6.0 KiB
Markdown
---
|
|
id: wiki-2026-0508-degrees-of-freedom
|
|
title: Degrees of Freedom (DOF)
|
|
category: 10_Wiki/Topics
|
|
status: verified
|
|
canonical_id: self
|
|
aliases: [DOF, degrees of freedom, kinematic DOF, statistical DOF]
|
|
duplicate_of: none
|
|
source_trust_level: A
|
|
confidence_score: 0.94
|
|
verification_status: applied
|
|
tags: [robotics, kinematics, statistics, mathematics, physics, mechanical]
|
|
raw_sources: []
|
|
last_reinforced: 2026-05-10
|
|
github_commit: pending
|
|
tech_stack:
|
|
language: Math / Robotics / Statistics
|
|
applicable_to: [Robotics, Statistics, Mechanics, ML]
|
|
---
|
|
|
|
# Degrees of Freedom (DOF)
|
|
|
|
## 매 한 줄
|
|
> **"매 system 의 independent parameter 의 count"**. 매 robotics: 매 movable joint. 매 statistics: 매 sample 의 free 의 vary. 매 modern AI: 매 model parameter (over-parameterization).
|
|
|
|
## 매 핵심
|
|
|
|
### 매 mechanical / robotics
|
|
- **Rigid body in 3D**: 6 DOF (3 translation + 3 rotation).
|
|
- **Rigid body in 2D**: 3 DOF.
|
|
- **Manipulator**: 매 joint 의 sum.
|
|
- **Mobile robot**: 매 base + arm.
|
|
|
|
### 매 Grübler-Kutzbach formula
|
|
```
|
|
DOF = λ(n - j - 1) + Σ f_i
|
|
```
|
|
- λ: 매 6 (3D), 3 (2D).
|
|
- n: 매 link 수 (base 포함).
|
|
- j: 매 joint 수.
|
|
- f_i: 매 joint 의 freedom.
|
|
|
|
### 매 statistical DOF
|
|
- **Sample variance**: n - 1 (mean 의 1 의 lose).
|
|
- **Linear regression**: n - p - 1 (p predictor).
|
|
- **Chi-square**: 매 categories - 1.
|
|
- **t-distribution**: 매 sample-dependent.
|
|
|
|
### 매 ML / DL
|
|
- **Effective DOF**: 매 model 의 parameter count.
|
|
- **Over-parameterization**: 매 modern DL 의 paradox (n_param >> n_data).
|
|
- **Implicit regularization**: 매 SGD 의 effective DOF 의 reduce.
|
|
|
|
### 매 응용
|
|
1. **Robot arm design**: 매 6+ DOF 의 redundancy.
|
|
2. **VR head tracking**: 6 DOF.
|
|
3. **Hand tracking**: 매 26 DOF (each hand).
|
|
4. **Statistics**: 매 hypothesis test.
|
|
5. **Camera pose**: 6 DOF.
|
|
|
|
## 💻 패턴
|
|
|
|
### Compute DOF (manipulator)
|
|
```python
|
|
def grubler_dof_3d(n_links, joints):
|
|
"""매 3D Grübler. joints: list of (type, freedom)."""
|
|
j = len(joints)
|
|
f_sum = sum(f for _, f in joints)
|
|
return 6 * (n_links - j - 1) + f_sum
|
|
|
|
# 매 6-axis arm: 6 revolute joints
|
|
arm = grubler_dof_3d(7, [('rev', 1)] * 6) # 6
|
|
# 매 4-bar linkage (planar)
|
|
def grubler_dof_2d(n, joints):
|
|
return 3 * (n - len(joints) - 1) + sum(f for _, f in joints)
|
|
fourbar = grubler_dof_2d(4, [('rev', 1)] * 4) # 1
|
|
```
|
|
|
|
### Statistical DOF (chi-square test)
|
|
```python
|
|
import scipy.stats as st
|
|
|
|
def chi2_dof(observed, expected):
|
|
chi2 = sum((o - e)**2 / e for o, e in zip(observed, expected))
|
|
dof = len(observed) - 1
|
|
p = 1 - st.chi2.cdf(chi2, dof)
|
|
return chi2, dof, p
|
|
```
|
|
|
|
### Sample variance (Bessel's correction)
|
|
```python
|
|
import numpy as np
|
|
|
|
def variance(data, ddof=1): # 매 ddof = degrees of freedom adjust
|
|
n = len(data)
|
|
mean = sum(data) / n
|
|
return sum((x - mean)**2 for x in data) / (n - ddof)
|
|
|
|
# 매 ddof=1: 매 sample (unbiased)
|
|
# 매 ddof=0: 매 population
|
|
```
|
|
|
|
### Effective DOF (ridge regression)
|
|
```python
|
|
def effective_dof_ridge(X, lam):
|
|
"""매 trace of hat matrix."""
|
|
XtX = X.T @ X
|
|
n_features = X.shape[1]
|
|
H = X @ np.linalg.inv(XtX + lam * np.eye(n_features)) @ X.T
|
|
return np.trace(H)
|
|
```
|
|
|
|
### 6-DOF pose (3D vision)
|
|
```python
|
|
class Pose6DOF:
|
|
def __init__(self, position, orientation):
|
|
self.t = np.array(position) # 매 [x, y, z]
|
|
self.q = orientation # 매 quaternion [w, x, y, z]
|
|
|
|
def as_matrix(self):
|
|
T = np.eye(4)
|
|
T[:3, 3] = self.t
|
|
# 매 quaternion → rotation matrix (Hamilton)
|
|
w, x, y, z = self.q
|
|
T[:3, :3] = np.array([
|
|
[1-2*(y*y+z*z), 2*(x*y-z*w), 2*(x*z+y*w)],
|
|
[2*(x*y+z*w), 1-2*(x*x+z*z), 2*(y*z-x*w)],
|
|
[2*(x*z-y*w), 2*(y*z+x*w), 1-2*(x*x+y*y)],
|
|
])
|
|
return T
|
|
```
|
|
|
|
### Hand tracking DOF
|
|
```python
|
|
HAND_DOF = {
|
|
'wrist': 6, # 매 free in space
|
|
'thumb': 5, # 매 CMC 의 2, MCP 의 1, IP 의 1, opposition 의 1
|
|
'index_finger': 4, # 매 MCP 2 + PIP 1 + DIP 1
|
|
'middle_finger': 4,
|
|
'ring_finger': 4,
|
|
'pinky_finger': 4,
|
|
}
|
|
total = sum(HAND_DOF.values()) # 27
|
|
```
|
|
|
|
### Redundancy (kinematic)
|
|
```python
|
|
def redundancy(robot_dof, task_dof):
|
|
"""매 redundancy = robot_dof - task_dof."""
|
|
return max(0, robot_dof - task_dof)
|
|
|
|
# 매 7-DOF arm + 매 6-DOF task → 1-DOF redundancy
|
|
# 매 self-motion 의 obstacle 의 avoid
|
|
print(redundancy(7, 6)) # 1
|
|
```
|
|
|
|
### Over-parameterization (DL)
|
|
```python
|
|
def model_dof(model):
|
|
"""매 deep learning effective DOF approximation."""
|
|
total = sum(p.numel() for p in model.parameters())
|
|
trainable = sum(p.numel() for p in model.parameters() if p.requires_grad)
|
|
return {'total': total, 'trainable': trainable}
|
|
|
|
# 매 GPT-3: 175B parameters >> 매 dataset size
|
|
# 매 overfitting paradox: 매 implicit regularization 의 explain
|
|
```
|
|
|
|
## 매 결정 기준
|
|
| 상황 | DOF Approach |
|
|
|---|---|
|
|
| Manipulator design | Grübler-Kutzbach |
|
|
| Robot redundancy | n_robot - n_task |
|
|
| Statistics test | Specific test formula |
|
|
| ML model | Parameter count + effective |
|
|
| VR / AR | 6 DOF (full) or 3 DOF (rotation) |
|
|
| Hand tracking | ~26 per hand |
|
|
|
|
**기본값**: 매 task-specific DOF + 매 redundancy 의 prefer (manipulator) + 매 statistical 의 ddof aware.
|
|
|
|
## 🔗 Graph
|
|
- 부모: [[Statistics]] · [[Robotics]]
|
|
- 변형: [[Kinematic-DOF]] · [[Statistical-DOF]]
|
|
- 응용: [[Denavit-Hartenberg-Parameters]] · [[Hypothesis-Testing]]
|
|
- Adjacent: [[Pose-Estimation]]
|
|
|
|
## 🤖 LLM 활용
|
|
**언제**: 매 robot design. 매 statistical analysis. 매 ML capacity.
|
|
**언제 X**: 매 informal usage.
|
|
|
|
## ❌ 안티패턴
|
|
- **Confuse statistical / mechanical**: 매 different concept.
|
|
- **Forget Bessel correction**: 매 biased estimator.
|
|
- **Under-DOF manipulator**: 매 task 의 reach X.
|
|
- **Over-DOF without redundancy logic**: 매 self-collision.
|
|
|
|
## 🧪 검증 / 중복
|
|
- Verified (Spong Robot Dynamics, Statistics textbook).
|
|
- 신뢰도 A.
|
|
|
|
## 🕓 Changelog
|
|
| 날짜 | 변경 |
|
|
|---|---|
|
|
| 2026-04-20 | Auto-reinforced |
|
|
| 2026-05-08 | Phase 1 |
|
|
| 2026-05-10 | Manual cleanup — mechanical + statistical DOF + 매 Grübler / chi2 / pose / redundancy code |
|