intelligente datenanalyse in matlab - cs.uni-potsdam.de · h. r. schwarz: numerische mathematik. 2...

Post on 21-Aug-2019

213 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

INTELLIGENTE DATENANALYSE IN MATLAB

Mathematische Grundlagen

Michael Brückner/Tobias Scheffer

Mathematische Grundlagen

Literatur

A F h K V L Al b E

Literatur

A. Fischer, K. Vetters: Lineare Algebra – Eine Einführung für Ingenieure und Naturwissenschaftler.H A J E h A l i I III H. Amann, J. Escher: Analysis I-III.

S. Boyd, L. Vandenbergh: Convex Optimization. R. Schlittgen: Einführung in die Statistik. H. R. Schwarz: Numerische Mathematik.

21.04.2009Michael Brückner/Tobias Scheffer2

Überblick

L Al b

Überblick

Lineare Algebra Analysis Stochastik Numerik

21.04.20093 Michael Brückner/Tobias Scheffer

Lineare Algebra: VektorenLineare Algebra: Vektoren

Vektor: 1

T1 m

xx x

x

x x

mx

x x 2x

Vektorsumme:11 1

11

nn

ii

m nm

x x

x x

x

1x2

3x1 2 3 x x x

Skalarprodukt:T

1, ,

m

i iix y

y x x y x yx

Skalarprodukt:

21.04.2009Michael Brückner/Tobias Scheffer4

, cosx y x y y

Lineare Algebra: MatrizenLineare Algebra: Matrizen

Matrix:

T11 1 11 1

1

n m

n

x x x x

X x x

Matrixsumme:

1 1m mn n mnx x x x

11 11 1 1n nx y x y X Y

Matrixprodukt:1 1m m mn mnx y x y

X Y

p

1 1 11 111 1 11 1

n n

i i i iki in k

x y x yx x y y

YX XY

21.04.2009Michael Brückner/Tobias Scheffer5

1 11

1 1

n nm mn n nk

mi i mi iki i

x x y yx y x y

Lineare Algebra: Geometrie

H b

Lineare Algebra: Geometrie

Hyperebene: T

0| ( ) 0H f w w x x x ww

Hw

z ( )f zw

Ellipsoid:0ww

T| ( ) 1E g A x x x Ax

21.04.2009Michael Brückner/Tobias Scheffer6

Lineare Algebra: Matrix-EigenschaftenLineare Algebra: Matrix Eigenschaften

Quadratisch: Symmetrisch:

n m11 1na a

A

TA Ay Spur (trace): Rang (rank):

1m mna a

1( )

m

iii

tr a

A

( ) Anzahl linear unabhänger Zielen/Spaltenrk A Rang (rank): Determinante: Positiv definit: T: 0 x 0 x Ax

2( ) ( )det vol E AA gilt nur falls A positiv definit

äquivalent gilt T: G A GG

( ) Anzahl linear unabhänger Zielen/Spaltenrk A

Positiv definit: : 0 x 0 x Ax äquivalent gilt : G A GG

21.04.2009Michael Brückner/Tobias Scheffer7

Lineare Algebra: Spezielle MatrizenLineare Algebra: Spezielle Matrizen

Eins-Vektor/-Matrix:1 1 1

, 1 1 1

1 1

Einheitsvektor:

T0 0 1 0 0i e

1i

Diagonalmatrix: 1

1 1

0( )

0m m

adiag a a

a e e

1i

Einheitsmatrix:

0 ma

1 0( )diag

I 1

21.04.2009Michael Brückner/Tobias Scheffer8

0 1

Lineare Algebra: Matrix-FaktorisierungLineare Algebra: Matrix Faktorisierung

T0l LU-Zerlegung (m = n):

11 11 1

1

0

0

m

m mm mm

l u u

l l u

A LU

Cholesky-Zerlegung (m = n): TA GG existiert nur falls A positiv definit

Eigenwert-Zerlegung (m = n):0

1

TT T1 1

01 falls

0 falls

0m m i j

m

i ji j

A VΣV v v v v v v

21.04.2009Michael Brückner/Tobias Scheffer9

EigenwerteEigenvektoren

Lineare Algebra: Matrix-FaktorisierungLineare Algebra: Matrix Faktorisierung

Singulärwert-Zerlegung (m > n):1 T0 1 falls i j

Singulärwerte

T

TT1 1

T

0 falls 0 1 falls

0 falls

i j

m nn

i j

i j

i ji j

v vA UΩV u u v v

u u0

g

Berechnung durch Eigenwert-Zerlegung von :

0 falls i j

0

TA A

11

T T T T

00

, , 00

i in

n

0A A V V AA U U

0 0

21.04.2009Michael Brückner/Tobias Scheffer10

n 0 0

Analysis: Distanzen

D f

Analysis: Distanzen

Definition:

Beispiele für Vektor-Distanzen

( , ) 0 ( , ) ( , ) ( , ) ( , ) ( , )d x y x y d x y d y x d x y d x z d z y

Norm von x:( 0)d

Minkowski-Distanz: Manhattan-Distanz:

1

mpp

i ipix y

x y

1x y

( ,0)x d x

Euklidische Distanz:

Beispiel für Matrix-Distanzen: Singulärwerteder Matrix

2x y

X Y Schatten-Distanz: Trace-Distanz:

1

mppip

i

X Yder Matrix

1tr X Y X Y

X Y

Frobenius-Distanz:

21.04.2009Michael Brückner/Tobias Scheffer11

2F X Y X Y

Analysis: Differentialrechnung

E Abl F k

Analysis: Differentialrechnung

Erste Ableitung einer Funktion f: Nach einem Skalar x:

Tf f

xffx

Nach einem Vektor x:1

( )m

f ff grad fx x

x

Gradient Partielle Ableitung

Zweite Ableitung einer Funktion f : Nach einem Skalar x:

g

2 2f f

22 ff

Nach einem Skalar x:

Nach einem Vektor x:21 1

2

2 2

( )mx x x

f H ff f

x

2x f x

21.04.2009Michael Brückner/Tobias Scheffer12

21m m

f fx x x

Hesse-Matrix

Analysis: Integralrechnung

I l F k

Analysis: Integralrechnung

Integral einer Funktion f: Über einem Skalar x:

Üb V k

( )xF f x x Über einem Vektor x:

Bestimmtes Integral:

1( ) ( ) mF f f x x x x x x

( ) ( ) ( )b

x xf x x F b F a

Umkehroperation:a

( ) xFf xx

Berechnung analytisch durch Integrationsregelnoder numerische Approximation (Quadraturformeln).

21.04.2009Michael Brückner/Tobias Scheffer13

Analysis: Konvexität

K F k

Analysis: Konvexität

Konvexe Funktion f:

Konkave Funktion f( (1 ) ) ( ) (1 ) ( )f tx t y tf x t f y

Konkave Funktion f:

Streng konvex bzw konkav:( (1 ) ) ( ) (1 ) ( )f tx t y tf x t f y

Streng konvex bzw. konkav: „“ bzw. „“ wird zu „“ bzw. „“. Es existiert genau ein Minimum bzw. Maximum. Es existiert genau ein Minimum bzw. Maximum. Zweite Ableitung ist überall positiv bzw. negativ. Tangente an f(x) ist untere bzw. obere Schranke von f.g f( ) f

21.04.2009Michael Brückner/Tobias Scheffer14

Analysis: Optimierung

O f b (OA)

Analysis: Optimierung

Optimierungsaufgabe (OA): f Zielfunktion.S l i B i h (d fi i d h N b b di )

* *min ( ) mit arg min ( )x S x S

f f x x f x

S zulässiger Bereich (definiert durch Nebenbedingungen). f*Optimalwert.

* ti l Lö x*optimale Lösung. Ein x S wird zulässige Lösung genannt.

K OA Konvexe OA: Zielfunktion und zulässiger Bereich konvex. L k l O ti = Gl b l O ti Lokales Optimum = Globales Optimum.

21.04.2009Michael Brückner/Tobias Scheffer15

Analysis: Optimierung

*

Analysis: Optimierung

Notwendige Optimalitätskriterien für x*: Wenn f in x* differenzierbar ist, dann ist .*( ) 0x f x

Wenn f in x* zweimal differenzierbar ist, dann ist eine positiv (semi-)definite Matrix.

OA h N b b di

2 *( )x f x

OA ohne Nebenbedingungen:mS

OA mit n Nebenbedingungen: | ( ) 0, ( ) 0, 1... , 1...m

i jS g g i k j k n x x x

21.04.2009Michael Brückner/Tobias Scheffer16

Analysis: Optimierung

L A f OA N b b d

Analysis: Optimierung

Lagrange-Ansatz für OA mit Nebenbedingungen: Nebenbed.:

L F k i | ( ) 0, ( ) 0, 1... , 1...m

i jS g g i k j k n x x xn

Lagrange-Funktion:

Dualität:1

( , ) ( ) ( )i ii

L f g

x α x x

* min ( ) min max ( , ) max min ( , )m mS

f f L L

x α 0 α 0x x

x x α x α

Dualitätslücke

Primale OA:

( )pf x ( )df α

( ) falls min ( ) mit ( )

f Sf f

x x Primale OA:

Duale OA:

min ( ) mit ( )falls m p p

xf f

S

x xx

max ( ) mit ( ) min ( , )md d

xf f L

α 0α α x α

21.04.2009Michael Brückner/Tobias Scheffer17

Stochastik: Wahrscheinlichkeitstheorie

Z f ll d f P d

Stochastik: Wahrscheinlichkeitstheorie

Zufallsexperiment: definierter Prozess, in dem eine Beobachtung ω erzeugt wird (Elementarereignis).E i i Ω M ll ö li h El Ereignisraum Ω: Menge aller möglichen Elementar-ereignisse.E i i T il d E i i Ereignis A: Teilmenge des Ereignisraums.

Wahrscheinlichkeitsfunktion P: Funktion welche W h h i li hk i f E i i A ΩWahrscheinlichkeitsmasse auf Ereignisse A aus Ωverteilt.

21.04.2009Michael Brückner/Tobias Scheffer18

Stochastik: Wahrscheinlichkeitstheorie

G l W h h l hk fk (K l A )

Stochastik: Wahrscheinlichkeitstheorie

Gültige Wahrscheinlichkeitsfkt. (Kolmogorow Axiome) Wahrscheinlichkeit von Ereignis :

Si h E i i0 ( ) 1P A A

Sicheres Ereignis: Für die Wahrscheinlichkeit zweier unabhängiger

(inkompatibler) Ereignisse und (d h )

( ) 1P

A B A B (inkompatibler) Ereignisse und (d.h. ) gilt:

Summenregel:

A B A B

( ) ( ) ( )P A B P A P B

( ) ( )iP A P A B Bi ist Partitionierung Ω Summenregel:

Produktregel: Satz von Bayes:

( ) ( | ) ( )P A B P A B P B

( ) ( )ii von Ω

( | ) ( )( | ) ( ) ( | ) ( ) ( | ) P B A P AP A B P B P B A P A P A B Satz von Bayes:

21.04.2009Michael Brückner/Tobias Scheffer19

( | ) ( )( | ) ( ) ( | ) ( ) ( | )( )

P A B P B P B A P A P A BP B

Stochastik: Wahrscheinlichkeitstheorie

Z f ll bl Abb ld l

Stochastik: Wahrscheinlichkeitstheorie

Zufallsvariable X: Abbildung eines elementaren Ereignisses auf einen numerischen Wert, . El t i i B l d Z f ll i bl X( )

:X x

Elementarereignis ω ↔ Belegung der Zufallsvariable X(ω)=x.

Verteilungsfunktion einer Zufallsvariable X:( ) ( ) ( | ( ) )F x P X x P X x

Dichtefunktion einer Zufallsvariable X:

( ) ( ) ( | ( ) )XF x P X x P X x

( ) ( ) ( | ( ) )f P X P X

Zusammenhang von Verteilungs- und Dichtefunktion:

( ) ( ) ( | ( ) )Xf x P X x P X x

( )a F

21.04.2009Michael Brückner/Tobias Scheffer20

( )( ) ( ) ( ) XX X X

F aF a f x x f ax

Stochastik: Informationstheorie

I f h l d R l

Stochastik: Informationstheorie

Informationsgehalt der Realisierung x einer Zufallsvariable X: Id I f ti i bhä i E i i

( ) ( )h x I X x

Idee: Information zweier unabhängiger Ereignissesoll sich addieren, .

Für zwei unabhängige Ereignisse gilt( , ) ( ) ( )h x y I X x I Y y

Für zwei unabhängige Ereignisse gilt

und somit mit .( , ) ( ) ( ) ( )p x y P X x Y y P X x P Y y

( , ) log ( , )h x y p x y ( ) ( ) log ( )h x I X x P X x

Für bedingte Ereignisse gilt: Analog zum Satz von Bayes gilt:

( , ) ( | ) ( )h x y h x y h y

21.04.2009Michael Brückner/Tobias Scheffer21

( | ) ( ) ( | ) ( ) ( | ) ( , ) ( )h x y h y h y x h x h x y h x y h y

Stochastik: Kenngrößen von Zufallsvariablen

V l /D h

Stochastik: Kenngrößen von Zufallsvariablen

Verteilung/Dichte. Wertebereich: stetig/diskret, endlich/unendlich, ... Erwartungswert (mittlere Realisierung):

E ( )Xx

X p x x

Varianz (mittlere quadratische Abweichung vom Erwartungswert):

Entropie (mittlerer Informationsgehalt):

2 22 E ( )X X Xx

X p x x p ( g )

21.04.2009Michael Brückner/Tobias Scheffer22

H E ( ) ( ) log ( )Xx

h X p x p x

Stochastik: Mathematische Statistik

A h D (S h b ) R l b

Stochastik: Mathematische Statistik

Annahme: Daten (Stichprobe) = Realisierungen bzw. Belegungen von Zufallsvariablen.Zi l A üb Ei h f d G d Ziel: Aussagen über Eigenschaften der Grund-gesamtheit (alle möglichen Belegungen) treffen.E i kl S hä d T f h fü l h Entwicklung von Schätz- und Testverfahren für solche Aussagen, z.B.: S hät fü P t V t il f kti Schätzer für Parameter von Verteilungsfunktionen. Signifikanztests für Aussagen.

21.04.2009Michael Brückner/Tobias Scheffer23

Numerik

Zi l K t kti d A l Al ith fü

Numerik

Ziel: Konstruktion und Analyse von Algorithmen für kontinuierliche mathematische Probleme, falls Keine exakte Lösung für ein Problem existiert, Keine exakte Lösung für ein Problem existiert, Exakte Lösung nicht effizient gefunden werden kann.

Konstruktionsprinzipien:p p Exakte Verfahren: exakte Lösung bei unendlicher

Rechnergenauigkeit. Näherungsverfahren: approximative Lösung.

Analysen: L f it St bilität/F hl l d R b th it Laufzeit, Stabilität/Fehleranalyse und Robustheit.

21.04.2009Michael Brückner/Tobias Scheffer24

Numerik: Fehler

F hl

Numerik: Fehler

Fehlerarten: Eingabefehler, Messfehler, Rundung auf Maschinengenauigkeit. S t ti h F hl ( B Di k ti i ) R d f hl Systematische Fehler (z.B. Diskretisierung), Rundungsfehler.

Beispiele: Additi d it 20 20 2010 10 10 Addition von x und y mit : Logarithmieren/Potenzrechnen: Fehlerfortpflanzung: Summieren n ähnlich großer Zahlen

x y

4040 ln 1 e

20 20 2010 10 10

Fehlerfortpflanzung: Summieren n ähnlich großer Zahlen

1

n

ii

y x

(1 ) mit ( ) 1 unda b a by f n f a b f a f b f a a x

21.04.2009Michael Brückner/Tobias Scheffer25

(1, ) mit ( , ) , 1, und ,2 2 ay f n f a b f a f b f a a x

Numerik: Anwendungen

L l Gl h

Numerik: Anwendungen

Lösung linearer Gleichungssysteme. Interpolation/Approximation von reellen Funktionen. Finden von Extremwerten (Nullstellen, Minima,

Maxima, Sattelpunkte, …) nichtlinearer Gleichungen. Numerische Differentiation/Integration. Anfangswert-/Randwertprobleme für Differential-

gleichungen. Eigenwertprobleme und Matrix-Faktorisierung.

21.04.2009Michael Brückner/Tobias Scheffer26

Numerik: Beispiel Nullstellenproblem

Z l F d

Numerik: Beispiel Nullstellenproblem

Ziel: Finden von mit . Newtonsches Näherungsverfahren:

0( ) 0g x 0x

0 0 0 1 0

Anwendung: Lösen von Optimierungsproblemen; für optimale Lösung x* gilt :

0 0 0 1 01 ( ) ( )t t x t tx x g x g x

*( ) 0 ( ) ( )x xf x g x f x für optimale Lösung x gilt :( ) ( ) ( )x xf g f

* * 2 * 1 *1 ( ) ( )t t x t x tx x f x f x

1( )H f ( )grad f

Quasi-Newton-Verfahren: Approximation von bzw

( )H f ( )grad f

0 1( )g x 1( )H f Approximation von bzw. .

21.04.2009Michael Brückner/Tobias Scheffer27

( )x tg x ( )H f

Zusammenfassung

M hi ll L i t i ß T il di

Zusammenfassung

Maschinelles Lernen ist zu einem großen Teil die Anwendung von Mathematik aus zahlreichen Gebieten, insbesondere der Statistik & Optimierung.G , S & Op g

Inhalt dieser Vorlesung ist Das Verstehen und Implementieren von Algorithmen des

Maschinellen Lernens.

Inhalt dieser Vorlesung ist NICHT Das Herleiten/Erklären der zugrunde liegenden

Mathematik.

21.04.2009Michael Brückner/Tobias Scheffer28

top related