Types of yield calculations differ depending on asset.
Stock dividend yields come in two varieties, cost yield and current yield.
If the you bought a stock for $20 and the dividend is $2, the cost yield is ($2/$20). If the stock is now valued at $22, and the current yield is ($2/$22). As the stock price increases, yield goes down as there is an inverse relationship between price and yield.
There are multiple bond yields.
The main ones are current yield, coupon yield and yield to maturity.
Coupon yield is the annual interest rate paid on the principal amount of a bond fixed at issuance. Current yield is the coupon yield on a bond at a specific point in the time before the bond maturity. The current yield is expressed as the bond interest rate as a percentage of the current price of the bond. A yield to maturity of a bond is the internal rate of return on a bond's cash flow, including the cost of the bonds, coupons, if paid, and the return of the principal at redemption. The yield to maturity is an estimate of what an investor will receive if the bond is held to its maturity date.