<< Chapter < Page Chapter >> Page >

The normal equations

Gradient descent gives one way of minimizing J . Let's discuss a second way of doing so, this time performing the minimization explicitlyand without resorting to an iterative algorithm. In this method, we will minimize J by explicitly taking its derivatives with respect to the θ j 's, and setting them to zero. To enable us to do this without having to write reamsof algebra and pages full of matrices of derivatives, let's introduce some notation for doing calculus with matrices.

Matrix derivatives

For a function f : R m × n R mapping from m -by- n matrices to the real numbers, we define the derivative of f with respect to A to be:

A f ( A ) = f A 11 f A 1n f A m1 f A mn

Thus, the gradient A f ( A ) is itself an m -by- n matrix, whose ( i , j ) -element is f / A i j . For example, suppose A = A 11 A 12 A 21 A 22 is a 2-by-2 matrix, and the function f : R 2 × 2 R is given by

f ( A ) = 3 2 A 11 + 5 A 12 2 + A 21 A 22 .

Here, A i j denotes the ( i , j ) entry of the matrix A . We then have

A f ( A ) = 3 2 10 A 12 A 22 A 21 .

We also introduce the trace operator, written “ tr .” For an n -by- n (square) matrix A , the trace of A is defined to be the sum of its diagonal entries:

tr A = i = 1 n A i i

If a is a real number (i.e., a 1-by-1 matrix), then tr a = a . (If you haven't seen this “operator notation” before, you shouldthink of the trace of A as tr ( A ) , or as application of the “trace” function to the matrix A . It's more commonly written without the parentheses, however.)

The trace operator has the property that for two matrices A and B such that A B is square, we have that tr A B = tr B A . (Check this yourself!) As corollaries of this, we also have, e.g.,

tr A B C = tr C A B = tr B C A , tr A B C D = tr D A B C = tr C D A B = tr B C D A .

The following properties of the trace operator are also easily verified. Here, A and B are square matrices, and a is a real number:

tr A = tr A T tr ( A + B ) = tr A + tr B tr a A = a tr A

We now state without proof some facts of matrix derivatives (we won't need some of these until later this quarter).  [link] applies only to non-singular square matrices A , where | A | denotes the determinant of A . We have:

A tr A B = B T A T f ( A ) = ( A f ( A ) ) T A tr A B A T C = C A B + C T A B T A | A | = | A | ( A - 1 ) T .

To make our matrix notation more concrete, let us now explain in detail the meaning of the first of these equations. Suppose we have some fixedmatrix B R n × m . We can then define a function f : R m × n R according to f ( A ) = tr A B . Note that this definition makes sense, because if A R m × n , then A B is a square matrix, and we can apply the trace operator to it; thus, f does indeed map from R m × n to R . We can then apply our definition of matrix derivativesto find A f ( A ) , which will itself by an m -by- n matrix. [link] above states that the ( i , j ) entry of this matrix will be given by the ( i , j ) -entry of B T , or equivalently, by B j i .

The proofs of the first three equations in [link] are reasonably simple, and are left asan exercise to the reader. The fourth equation in [link] can be derived using the adjoint representation of the inverse of a matrix. If we define A ' to be the matrix whose ( i , j ) element is ( - 1 ) i + j times the determinant of the square matrix resulting from deleting row i and column j from A , then it can be proved that A - 1 = ( A ' ) T / | A | . (You can check that this is consistent with the standard wayof finding A - 1 when A is a 2-by-2 matrix. If you want to see a proof of this more general result, see an intermediate or advancedlinear algebra text, such as Charles Curtis, 1991, Linear Algebra , Springer.) This shows that A ' = | A | ( A - 1 ) T . Also, the determinant of a matrix can be written | A | = j A i j A i j ' . Since ( A ' ) i j does not depend on A i j (as can be seen from its definition), this implies that ( / A i j ) | A | = A i j ' . Putting all this together shows the result.

Questions & Answers

what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
What are the treatment for autism?
Magret Reply
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities. before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue.. sometimes due to these physical problems..the diagnosis may be misdiagnosed. treatment for autism. well it depends on the severity. since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision. play therapy. speech therapy. Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game. string and beads game. the more you interact with the child the more effective
Jharna
results you'll get.. please consult a therapist to know what suits best on your child. and last as a parent. I know sometimes it's overwhelming to guide a special kid. but trust the process and be strong and patient as a parent.
Jharna
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Machine learning. OpenStax CNX. Oct 14, 2013 Download for free at http://cnx.org/content/col11500/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Machine learning' conversation and receive update notifications?

Ask