666 views|0 replies

43

Posts

2

Resources
The OP
 

The Beauty of Control (Volume 2) Section 7 - Matrix Derivatives [Copy link]

This post was last edited by Zhao_kar on 2024-3-3 15:38

The Beauty of Control (Volume 2) Section 7 - Matrix Derivative Example - Linear Regression

statement:

  • This section uses a simple practical example to expand the vector matrix derivative, also the previous athlete example
  • There are only 15 athletes and only two variables need to be considered: height and weight.

Example introduction:

  • First, we can draw a scatter plot of height + weight based on the data. Generally, the taller the height, the heavier the weight. We can use a linear function to represent
  • At this time, a prediction equation is defined as the following figure, where from left to right are the estimated height, two parameters and an actual weight.

  • We need to confirm y1 and y2, and define a cost function to minimize the loss. The cost function is defined as the second formula in the figure above:
  • The difference between the left and right sides of the equation is the error between the actual value and the estimated value. That is to say, when the sum of squares is minimized, the prediction equation can better reflect the relationship between the data.
  • This method is called the least squares method

calculation process:

  • The first step is to write the four parameters in matrix form, construct the equation, and then introduce the cost function

  • Then after getting a function, divide it into three parts and do the derivation. The derivation formula is shown in the upper left part of the figure below, and the result on the right side is obtained after calculation:

  • Finally, attach the simulation verification

This post is from Automotive Electronics

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list