Course Review Introduction to Computer Methods

Similar documents
GAUSS ELIMINATION. Consider the following system of algebraic linear equations

Definition of Tracking

Rank One Update And the Google Matrix by Al Bernstein Signal Science, LLC

DCDM BUSINESS SCHOOL NUMERICAL METHODS (COS 233-8) Solutions to Assignment 3. x f(x)

Variable time amplitude amplification and quantum algorithms for linear algebra. Andris Ambainis University of Latvia

Chapter Newton-Raphson Method of Solving a Nonlinear Equation

CISE 301: Numerical Methods Lecture 5, Topic 4 Least Squares, Curve Fitting

Principle Component Analysis

Chapter Newton-Raphson Method of Solving a Nonlinear Equation

Review of linear algebra. Nuno Vasconcelos UCSD

Dennis Bricker, 2001 Dept of Industrial Engineering The University of Iowa. MDP: Taxi page 1

Applied Statistics Qualifier Examination

8. INVERSE Z-TRANSFORM

Least squares. Václav Hlaváč. Czech Technical University in Prague

Fall 2012 Analysis of Experimental Measurements B. Eisenstein/rev. S. Errede. with respect to λ. 1. χ λ χ λ ( ) λ, and thus:

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

6 Roots of Equations: Open Methods

ME 501A Seminar in Engineering Analysis Page 1

UNIVERSITY OF IOANNINA DEPARTMENT OF ECONOMICS. M.Sc. in Economics MICROECONOMIC THEORY I. Problem Set II

Remember: Project Proposals are due April 11.

Linear and Nonlinear Optimization

The Schur-Cohn Algorithm

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

In this Chapter. Chap. 3 Markov chains and hidden Markov models. Probabilistic Models. Example: CpG Islands

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Introduction to Numerical Integration Part II

4. Eccentric axial loading, cross-section core

INTERPOLATION(1) ELM1222 Numerical Analysis. ELM1222 Numerical Analysis Dr Muharrem Mercimek

Operations with Polynomials

Multiple view geometry

p-adic Egyptian Fractions

Quiz: Experimental Physics Lab-I

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

6.6 The Marquardt Algorithm

Fitting a Polynomial to Heat Capacity as a Function of Temperature for Ag. Mathematical Background Document

Model Fitting and Robust Regression Methods

A-Level Mathematics Transition Task (compulsory for all maths students and all further maths student)

Lecture 4: Piecewise Cubic Interpolation

Chapter 6 Continuous Random Variables and Distributions

MATHEMATICS AND STATISTICS 1.2

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

Sample pages. 9:04 Equations with grouping symbols

Chapter 5 Supplemental Text Material R S T. ij i j ij ijk

Equations and Inequalities

Statistics and Probability Letters

1 Linear Least Squares

Lecture 36. Finite Element Methods

1B40 Practical Skills

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio.

a = Acceleration Linear Motion Acceleration Changing Velocity All these Velocities? Acceleration and Freefall Physics 114

Shuai Dong. Using Math and Science to improve your game

Partially Observable Systems. 1 Partially Observable Markov Decision Process (POMDP) Formalism

CH 9 INTRO TO EQUATIONS

5.2 Exponent Properties Involving Quotients

AQA Further Pure 2. Hyperbolic Functions. Section 2: The inverse hyperbolic functions

The Algebra (al-jabr) of Matrices

The Number of Rows which Equal Certain Row

5.3 The Fundamental Theorem of Calculus

INTRODUCTION TO LINEAR ALGEBRA

along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!!

Scientific notation is a way of expressing really big numbers or really small numbers.

Recitation 3: More Applications of the Derivative

ORDINARY DIFFERENTIAL EQUATIONS

Lecture 3 Gaussian Probability Distribution

Appendix 3, Rises and runs, slopes and sums: tools from calculus

Problem Set 9. Figure 1: Diagram. This picture is a rough sketch of the 4 parabolas that give us the area that we need to find. The equations are:

Lesson 1: Quadratic Equations

Demand. Demand and Comparative Statics. Graphically. Marshallian Demand. ECON 370: Microeconomic Theory Summer 2004 Rice University Stanley Gilbert

Calculus 2: Integration. Differentiation. Integration

ODE: Existence and Uniqueness of a Solution

Pyramid Algorithms for Barycentric Rational Interpolation

INTRODUCTION TO COMPLEX NUMBERS

Katholieke Universiteit Leuven Department of Computer Science

In Section 5.3 we considered initial value problems for the linear second order equation. y.a/ C ˇy 0.a/ D k 1 (13.1.4)

For the percentage of full time students at RCC the symbols would be:

Statistics 423 Midterm Examination Winter 2009

Equations, expressions and formulae

ESCI 342 Atmospheric Dynamics I Lesson 1 Vectors and Vector Calculus

STRAND B: NUMBER THEORY

Lecture 3 Camera Models 2 & Camera Calibration. Professor Silvio Savarese Computational Vision and Geometry Lab

Two Coefficients of the Dyson Product

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

CS434a/541a: Pattern Recognition Prof. Olga Veksler. Lecture 9

Bases for Vector Spaces

Operations with Matrices

Kinematics Quantities. Linear Motion. Coordinate System. Kinematics Quantities. Velocity. Position. Don t Forget Units!

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VII

Lecture 1. Functional series. Pointwise and uniform convergence.

INTRODUCTORY NUMERICAL ANALYSIS

Arithmetic & Algebra. NCTM National Conference, 2017

Purpose of the experiment

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Department of Mechanical Engineering, University of Bath. Mathematics ME Problem sheet 11 Least Squares Fitting of data

FUNDAMENTALS ON ALGEBRA MATRICES AND DETERMINANTS

Chapter 2 Intro to Math Techniques for Quantum Mechanics

UNIT 3 Indices and Standard Form Activities

Lecture Solution of a System of Linear Equation

Lecture Notes on Linear Regression

Math 426: Probability Final Exam Practice

Transcription:

Course Revew Wht you hopefully hve lerned:. How to nvgte nsde MIT computer system: Athen, UNIX, emcs etc. (GCR). Generl des bout progrmmng (GCR): formultng the problem, codng n Englsh trnslton nto computer lnguge edtng complng + debuggng runnng 3. Qute bt of knowledge of C (GCR, mdterm).

Course Revew 4. MATLAB: Mtlb mtr lbortory, mtr orented. Any vrble s n rry by defult, thus lmost no declrtons. All vrbles re by defult double Hgh level lnguge: () quck nd esy codng () lots of tools (Spectrl Anlyss, Imge Processng, Sgnl Processng, Fnncl, Symbolc Mth etc.) () reltvely slow

Course Revew Trnsltor - nterpreter, reds nd eecutes lne fter lne, but All Mtlb functons re precompled. One (YOU) my dd etr functons by cretng M- fles. Lnguge structure s smlr to C: - MATLAB supports vrbles, rrys, structures, subroutnes, fles, flow of control structures -MATLAB does NOT support ponters nd does not requre vrble declrtons

Delng wth Mtrces n Mtlb Mtlb hs ll stndrd opertons & functons mplemented for mtrces (& vectors). Stndrd mth. functons of mtrces operte n rry sense (ct on ech mtr entry ndependently: ep(a), sn(a), sqrt(a) A.^0.5 >> B ep(a) B(,j) ep(a(,j)) Any mtr multplcton/dvson or rsng mtr nto some power my be both mtr nd rry operton.

Delng wth Mtrces n Mtlb A*B - mtr product of n m nd m p mtrces, but A.*B - rry (element by element) product of two n m mtrces. Bsqrt(A) Å B j sqrt(a j ), A&B - ny mtrces, but BA^0.5 Å AB*B nd A&B should be squre. Submtrces: / A(:4,3) - column vector, frst 4 elements of the 3-d column of A. A(:,3) - the 3-d column of A A(:,[ 4]) - columns of A: -d & 4-th.

Delng wth Mtrces, Emples >> C A + B; C(k,l) A(k,l) + B(k,l) >> C A*B; C(k,l) A(k,m) * B(m,l) >> C A.*B C(k,l) A(k,l)*B(k,l) >> C A^lph; >> C A.^lph; C(k,l) A(k,l)^lph Mtr multplcton, summton over the repetng nde s mpled. Element-wse (rry) operton

Course Revew I hope you ve lerned the bsc lner lgebr nd t s Mtlb mplctons:. Mtr(vector) ddton/subtrcton & multplcton. Sy, wht s the dfference between *b nd *b, where nd b re vectors?. Colon notton nd opertng wth submtrces. Remember, lots of summton, multplcton etc. loops my be elmnted by usng the colon notton (see soluton to hw8-0 for emple). 3. Bsc Mtlb synt: Gven you know C, you my fgure out mny Mtlb propertes by nlogy, but stll you re epected to hve cler de bout:

Course Revew wrtng functons n Mtlb flow of control sttements How to use desktop & mntn the workspce. How to del wth blck boes : ) help FUNCTIONNAME ) wht does the functon do? ) wht s n nd wht s out? v) how to prepre wht s n (usully vectors nd mtrces) v) delly: wht s nsde the blck bo, to predct possble problems

5. You hve lerned bout set of generl problems, whch cn be solved by progrmmng: root fndng (GCR), systems of lner equtons, systems of non-lner equtons, fttng epermentl dt.

Mtr Formulton of SLE System of lner equtons, emple: + + + n n b + +.+ n n b.. n + n + + nn n b n A - coeffcent mtr, b - lod vector.. n n n n nn... n b b... b n A b

Gussn Elmnton Emple: + y + z 0 + y + 3 z 3 - + 3 y + 0 z -4. Elmnte from eqs & 3.. Elmnte y from equton. 3. Solve eq. 3 for z nd bcksubsttute to eqs & 4. Solve eq. for y nd bcksubsttute to eq.. 5. Solve eq. for.

Gussn Elmnton (lst step) Subtrct m 3 tmes () from (3) * + () + + 3 () 3 (3) 33 3 3 3 b b b () (3) 3 () () (3) * ** The new coeffcents re gve by b (3) 33 (3) 3 b () 33 () 3 m m 3 3 b () 3 ()

Sclblty Code for Gussn elmnton contns 3 loops:. mkes n- runs to elmnte vrbles. k-th run goes through n-k rows (k,..., n-) 3. n -th row we clculte j j - m kj n-k tmes Overll bout n k (n k)(n k) opertons. Tme scles s n 3! A rther poor sclblty.

LU fctorzton. GE A ------> U (upper dgonl) GE b -------> c A LU b L c A LU L - descrbes Gussn elmnton. c L - b

Numercl Stblty Problems pper f we hve smll numbers t the dgonl of the coeffcents mtr. Soluton - pvotng. Pvotng lgorthm: Serches for the lrgest k n ech row below the current one to use for the net elmnton step, nd rerrnges the rows so tht m k s lwys less thn one.

Introducton to Dt Anlyss Rndom & Systemtc Errors How to Report nd Use Epermentl Errors Sttstcl Anlyss of Dt Sttstcs of rndom errors Error propgton, functons of mesurbles Plottng nd dsplyng the dt Fttng the dt: lner nd non-lner regresson

Sttstcl Anlyss of Rndom Errors. Men N best N Devton d Stndrd devton, σ root men squre of the mesurements N N (d ) ( ) N N

Propgton of Errors If errors re ndependent nd rndom: for the sum/dfference the errors of the ndependent tems re dded n qudrture. q + y ( ) ( ) δq δ + δ y δ+ δ y q +... + z ( u+... + w) ( )... ( ) ( )... ( ) δq δ + + δz + δu + + δw δ+... + δz+ δu+... + δw

q... z u... w Propgton of Errors Reltve error of product/quotent: δq δ δz δu δw +... + + +... + q z u w δ δz δu δw +... + + +... + z u w Reltve errors of ndependent mesurbles re dded n qudrture.

Propgton of Errors Generl cse - functon of severl vrbles: q(,...,z) δ q q q... δ z δ + + Error of power: q n δq q n δ

Gussn Dstrbuton For lrge number of mesurements nd rndom smll errors the dstrbuton of epermentl dt s Gussn: ( ) G ep, σ σ π σ P(, + d) G()d (probblty densty) P( b) G()d b G()d (normlzed) G( + d) G( d) (symmetrc wth respect to )

Lest Squres Fttng Multple mesurbles y, y,, y N, t dfferent vlues of :,,, N ; y f( ). Need to ft mesurbles y, to functon y(). The smplest cse - lner dependence: y + b. Wht re the best nd b to ft the dt?. Suggest Gussn dstrbuton for ech y, know s y.. Construct P(y, y,, y N ;,b). 3. Mmze P(y, y,, y N ;,b) wth respect to & b. 4. Fnd nd b delverng the m. vlue of P(y, y,, y N ;,b).

Probblty of sngle mesurement: Lest Squres Fttng P(y ) Probblty of set of mesurements: : ep ( ) σ y σ y N y ( + b) χ P(y, y,..., y N) : ep, N σ y χ y ( + b) ( ) σ y χ χ We look for : 0 & 0 b

Lest Squres Fttng We hve system of two lner equtons for &b wth the solutons: b y y y y, where A + b - lest squres ft to the dt, or lne of regresson of y on. ( )

Lner Lest Squres, Generl cse Our fttng functon n generl cse s: F() f () + f () + + n f n () f, f,, f n - known functons of,,,, n unknown fttng prmeters Note tht the functon tself does not hve to be lner for the problem to be lner n the fttng prmeters. There s compct wy to formulte the lest squres problem: mtr form.

Lner Lest Squres, Generl cse Let us epress the problem n mtr notton: f( ) f( )... fn ( ) ( ) ( )... ( ) Z f f fn............ f( N ) f( N )... fn( N ) Overll we hve now: y Z + e Fttng problem n mtr notton. z N T Look for mn e mn( e e) T z z T y or ( T ) T z z z y

Nonlner Regresson (Lest Squres) Wht f the fttng functon s not lner n fttng prmeters? We get nonlner equton (system of equtons). Emple: f() ( - e - ) + e y f ( ;,,..., ) + e or just y f( ) + e m Agn look for the mnmum of to the fttng prmeters. N e wth respect

Nonlner Regresson (Lest Squres) + + + + + n N n N n N N n j j j j n j j j j f f f f z f y f y D where e z D N for e f f y e f f e f y 0), (... 0), (......... 0), (... 0), ( 0), (... 0), (, form : mtr n or,,...,, 0), ( ) 0 ( 0), ( 0), ( ) 0 ( 0), ( ), (

Nonlner Regresson (Lest Squres) Lner regresson: y z + e Å z T z z T y Now, nonlner regresson: D z + e Å z T z z T D Old good lner equtons wth n plce of, D n plce of y nd z wth prtl dervtves n plce of z wth vlues of fttng functons. Besdes, n cse of lner regresson t ws enough to solve the SLE once, whle now solvng the bove system we just get the net ppromton to the best ft.

Systems of Nonlner Equtons A system of non-lner equtons: f (,,,, N )0 f (,,,, N )0 > f()0.. Strt from ntl guess [0] f N (,,,, N )0 As before epnd ech equton t the soluton wth f( )0: N N N f () f () j j j j k k j j jk j k [0] Assume s close to nd dscrd qudrtc terms f () f () + ( ) + ( ) ( ) +... N f() (j ) j j f() j :

Lnerze the system of equtons. Pck n ntl guess 0. Solve lnerzed system for correcton to the ntl guess. Use 0 + s ntl guess, nd solve the lner system gn. Repet ths procedure untl the convergence crteron s stsfed. Mtr formulton of lnerzed equtons: J( [] ) [] -f( [] ), where J Jcobn mtr, J j f /, [] [+] - []. j