Update Summary
This commit is contained in:
		
							parent
							
								
									973e4b8c48
								
							
						
					
					
						commit
						9dd8e8e334
					
				
							
								
								
									
										120
									
								
								notes/Summary.md
									
									
									
									
									
								
							
							
						
						
									
										120
									
								
								notes/Summary.md
									
									
									
									
									
								
							@ -178,14 +178,77 @@ Dieser sollte $$-1 \leq BAL(N)\leq 1$$
 | 
			
		||||
## 5. Reelwertige Optimierung in einer Dimension
 | 
			
		||||
 | 
			
		||||
Bisektion mit Sampling. I.e. man macht Bisektion mehrere Male, mit anderen Intervallen.
 | 
			
		||||
Also z.B. komplettes intervall ist $I=[1, 10]$, und dort sind vielleicht 4 lokale Minima.
 | 
			
		||||
Dann macht man halt $$I_1=[1, 4], I_2=[4,7], I_3=[7, 10]$$
 | 
			
		||||
Und führt auf den Intervallen Bisektion aus und nimmt das beste Ergebnis.
 | 
			
		||||
 | 
			
		||||
Ganz Normal Newton Verfahren mit Schrittweitensteuerung.
 | 
			
		||||
 | 
			
		||||
### Straf- (Penalty-) Funktionen
 | 
			
		||||
 | 
			
		||||
**Grundidee**  
 | 
			
		||||
Mit einer Straffunktion $$p(x)$$ wird ein restringiertes Problem
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
\text{Min } f(x), \qquad A \le x \le B
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
auf ein *unrestringiertes* Problem
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
\text{Min } \Phi(x) \;=\; f(x) + p(x)
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
abgebildet.  Die Strafe $$p(x)$$ ist null im gültigen Bereich und wächst quadratisch, sobald eine Schranke verletzt wird.
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
#### Quadratische Strafterme (2-mal diff'bar)
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
p_1(x) \;=\; \beta (x-A)^2 \quad \text{für } x \ge A,\;\text{sonst }0,
 | 
			
		||||
$$
 | 
			
		||||
$$
 | 
			
		||||
p_2(x) \;=\; \beta (x-B)^2 \quad \text{für } x \le B,\;\text{sonst }0,
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
p(x) \;=\; p_1(x) + p_2(x), \qquad \beta>0.
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
Je größer $\beta$, desto stärker die Strafe ⇒ höhere Genauigkeit am Rand, aber auch instabilere Newton-Schritte.
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
#### Beispiel
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
\text{Min } e^x, \qquad 0 \le x \le 1.
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
Strafterme  
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
p_1(x)=\beta x^2, \qquad p_2(x)=\beta (x-1)^2,
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
Gesamtfunktion  
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
\Phi(x)=e^x + p_1(x) + p_2(x).
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
*Ableitungen einsetzen → Newton-Iteration mit $\Phi$ anstelle von $f$.*
 | 
			
		||||
 | 
			
		||||
> **Merke:** Die Wahl von $\beta$ ist ein Kompromiss zwischen Genauigkeit und numerischer Stabilität.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 6. Bivariate Lineare Programmierung
 | 
			
		||||
1. Nebenbedingungen Aufbauen (Ungleichungen)
 | 
			
		||||
2. Nach $y$ auflösen und einzeichnen
 | 
			
		||||
2. Nach $y$ auflösen und einzeichnen (Aufpassen)
 | 
			
		||||
3. Lösung finden
 | 
			
		||||
 | 
			
		||||
>Werden beide Seiten einer Ungleichung mit einer negativen Zahl multipliziert oder durch eine negative Zahl dividiert, muss das Ungleichheitszeichen umgekehrt werden (z.B. aus $<$ wird $>$)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 7. Reelwertige Optimierung in N Dimensionen
 | 
			
		||||
@ -195,7 +258,6 @@ $$f(x_1, x_2,..., x_n)$$
 | 
			
		||||
$$ f'(x) \longrightarrow \nabla f(x)$$
 | 
			
		||||
$$f''(x) \longrightarrow H$$
 | 
			
		||||
 | 
			
		||||
TODO: hesse matrix
 | 
			
		||||
### 7.2 Downhill-Simplex
 | 
			
		||||
 | 
			
		||||
Besteht aus n+1 Punkten
 | 
			
		||||
@ -225,27 +287,55 @@ $$mean((f_{x_i} - mean([...f_x]))^2)$$
 | 
			
		||||
### 7.3 Newton
 | 
			
		||||
Für 1 Parameter:
 | 
			
		||||
$$x_{n+1} = x_n - \frac{f'(x)}{f''(x)}$$
 | 
			
		||||
 | 
			
		||||
Für 1< Parameter:
 | 
			
		||||
$$x_{x+1} = x_n - H^{-1}_n * \nabla f_n$$
 | 
			
		||||
 | 
			
		||||
Mit Schrittweitensteuerung:
 | 
			
		||||
$$x_{x+1} = x_n - c_i * H^{-1}_n * \nabla f_n$$
 | 
			
		||||
 | 
			
		||||
Straffunktion:
 | 
			
		||||
Sei $A \leq x \leq B$ eine Restriktion für ein Optimierungsproblem. Dann
 | 
			
		||||
 | 
			
		||||
kann man die Restriktion $A \leq x \leq B$ in das Optimierungsproblem mittels einer Straf- bzw. Penaltyfunktion einbauen. Eine häufig verwendete Methode ist die quadratische Strafterm-Methode:
 | 
			
		||||
 | 
			
		||||
**1. Partielle Ableitungen**
 | 
			
		||||
$f_{xx}$ ist $f(x, y)$, zweimal partiell nach x abgeleitet. $f_{xy}$ wäre einmal nach $x$ und ein zweites mal nach $y$ abgeleitet.
 | 
			
		||||
$$
 | 
			
		||||
\phi(x) = f(x) + \mu \cdot \left( \sum_i \max(0, A_i - x_i)^2 + \sum_i \max(0, x_i - B_i)^2 \right)
 | 
			
		||||
f_{xx} = \frac{\partial^{2} f}{\partial x^{2}},\qquad
 | 
			
		||||
f_{xy} = \frac{\partial^{2} f}{\partial x\,\partial y},\qquad
 | 
			
		||||
f_{yx} = \frac{\partial^{2} f}{\partial y\,\partial x},\qquad
 | 
			
		||||
f_{yy} = \frac{\partial^{2} f}{\partial y^{2}}.
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
Dabei ist:
 | 
			
		||||
- $f(x)$ die ursprüngliche Zielfunktion,
 | 
			
		||||
- $\mu > 0$ ein Strafparameter, der die Stärke der Strafe reguliert,
 | 
			
		||||
- $A_i$, $B_i$ die untere bzw. obere Schranke für $x_i$.
 | 
			
		||||
**2. Gradient**
 | 
			
		||||
Vektor mit $\text{1. Partieller Ableitung nach x}$ in der $x$ Komponente, respektive part. diff. y in y . 
 | 
			
		||||
$$
 | 
			
		||||
\nabla f(x,y)=
 | 
			
		||||
\begin{pmatrix}
 | 
			
		||||
\displaystyle\frac{\partial f}{\partial x}\\[6pt]
 | 
			
		||||
\displaystyle\frac{\partial f}{\partial y}
 | 
			
		||||
\end{pmatrix}.
 | 
			
		||||
$$
 | 
			
		||||
 | 
			
		||||
Ziel ist es, eine neue Funktion $\phi(x)$ zu minimieren, die außerhalb des zulässigen Bereichs stark anwächst, sodass die Minimierung bevorzugt innerhalb der Restriktionen erfolgt.
 | 
			
		||||
 | 
			
		||||
**3. Hesse Matrix und Determinante**
 | 
			
		||||
$$
 | 
			
		||||
H=
 | 
			
		||||
\begin{pmatrix}
 | 
			
		||||
f_{xx} & f_{xy}\\
 | 
			
		||||
f_{yx} & f_{yy}
 | 
			
		||||
\end{pmatrix},
 | 
			
		||||
\qquad
 | 
			
		||||
\det H = f_{xx}\cdot f_{yy}-(f_{xy})^2.
 | 
			
		||||
$$
 | 
			
		||||
**4. Inverse Hesse-Matrix bestimmen**
 | 
			
		||||
 | 
			
		||||
$$
 | 
			
		||||
H^{-1}=\frac{1}{\det H}
 | 
			
		||||
\begin{pmatrix}
 | 
			
		||||
f_{yy} & -f_{xy}\\
 | 
			
		||||
-f_{xy} & f_{xx}
 | 
			
		||||
\end{pmatrix}.
 | 
			
		||||
$$
 | 
			
		||||
### 7.4 Steepest-Descent
 | 
			
		||||
Newton aber mit Hesse-Matrix = 1
 | 
			
		||||
$$x_{x+1} = x_n - c_i  * \nabla f_n$$
 | 
			
		||||
Newton aber mit $H^{-1} \approx 1$. Btw. das $c$ ist wichtig, weil der Gradient nur ne Richtung ist.
 | 
			
		||||
$$x_{x+1} = x_n - c_i  * \nabla f_n$$
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user