Package 'corpmetrics'

Title: Tools for Valuation, Financial Metrics and Modeling in Corporate Finance
Description: Balance sheet and income statement metrics, investment analysis methods, valuation methods, loan amortization schedules, and Capital Asset Pricing Model.
Authors: Pavlos Pantatosakis [aut, cre]
Maintainer: Pavlos Pantatosakis <[email protected]>
License: GPL (>= 2)
Version: 1.0
Built: 2024-11-11 05:14:31 UTC
Source: https://github.com/cran/corpmetrics

Help Index


Corporate Finance Metrics and Basic Tools

Description

This package provides essential financial functions tailored for Economics undergraduates, MBA students, and investors, enabling them to evaluate and screen investment opportunities effectively. It covers a wide range of corporate finance topics, including Key Performance Indicators (KPIs) from balance sheets and income statements, investment analysis methods such as Net Present Value (NPV) and Internal Rate of Return (IRR), valuation techniques for discounted dividends and fixed income securities. Additionally, it includes loan amortization schedules and the Capital Asset Pricing Model (CAPM).

Details

Package: corpmetrics
Type: Package
Version: 1.0
Date: 2024-09-08
License: GPL-2

Maintainers

Pavlos Patantosakis [email protected].

Author(s)

Pavlos Pantatosakis [email protected].

References

The Investopedia Team (2024). Useful Balance Sheet Metrics. https://www.investopedia.com/financial-edge/1012/useful-balance-sheet-metrics.aspx)

Hayes A. (2024). Profitability Ratios: What They Are, Common Types, and How Businesses Use Them. https://www.investopedia.com/terms/p/profitabilityratios.asp

Picardo E. (2024). P/E Ratio vs. EPS vs. Earnings Yield: What's the Difference? https://www.investopedia.com/articles/investing/120513/comparing-pe-eps-and-earnings-yield.asp

Berk, J. B. and DeMarzo, P. M. (2017). Corporate finance. Pearson Education. - ISBN: 1292160160

Ehrhardt, M. C. and Brigham, E. F. (2010). Corporate finance: A focused approach. South-Western Cengage Learning. - ISBN: 1439078084

Jordan, B. D., Ross, S. A., and Westerfield, R. W. (2010). Fundamentals of corporate finance. McGraw Hill. - ISBN: 9780073382395

Will Kenton (2024). Capital Asset Pricing Model (CAPM): Definition, Formula, and Assumptions. https://www.investopedia.com/terms/c/capm.asp


Balance Sheet Key Performance Indicators (KPIs)

Description

Calculate balanace sheet ratios: (1) Working Capital, (2) Current Ratio, (3) Acid Test Ratio, (4) Leverage (L/A), (5) Debt-to-Equity.

Usage

balsh(FA,CA,INV,FL,CL)

Arguments

FA

Fixed Assets (Numeric Variable).

CA

Current Assets (Numeric Variable).

INV

Inventory (Numeric Variable).

FL

Fixed (Long-term) Liabilities (Numeric Variable).

CL

Current (Short-term) Liabilities (Numeric Variable).

Details

Total Assets, Total Liabilities and Total Equity are computed in function.

Value

A data.frame with the 5 metrics and their respective values.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

The Investopedia Team (2024. Useful Balance Sheet Metrics. https://www.investopedia.com/financial-edge/1012/useful-balance-sheet-metrics.aspx)

Examples

##
# Example usage
example <- balsh(
  FA = 2450000, # Fixed Assets
  CA = 770000,  # Current Assets
  INV = 450000, # Inventory
  FL = 1180000, # Fixed Liabilities
  CL = 490000   # Current Liabilities
)

print(example)

Capital Asset Pricing Model (CAPM)

Description

Calculate if a stock is fairly valued based on Capital Asset Pricing Model (CAPM) returns.

Usage

capm(Rf,Ri,Rm)

Arguments

Rf

A numerical vector with the risk-free rates.

Ri

A numerical vector with the yields of the asset.

Rm

A numerical vector with the yields of the market.

Details

Use the same length for the three vectors.

Value

A data.frame including the required return based on Capital Asset Pricing Model (CAPM), the expected (mean) return of the asset and the asset's beta. Lastly, the stock's valuation is assessed: the stock is considered overvalued if the required return exceeds the expected return, and undervalued if the expected return is higher than the required return.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

Will Kenton (2024). Capital Asset Pricing Model (CAPM): Definition, Formula, and Assumptions. https://www.investopedia.com/terms/c/capm.asp

Examples

##
# Example usage

Rf <- rnorm(250, 0.03, 0) # Constant 3% risk free rate
Ri <- rnorm(250, 0.13, 0.10) # Asset under study
Rm <- rnorm(250, 0.09, 0.04) # Market's (can be an index) returns

example <- capm(Rf,Ri,Rm)
print(example)

#You can add a data.frame with real data
#Choose a vector with the risk free rate (Rf)
#Choose a vector with the stock returns (Ri)
#Choose a vector with the market returns (Rm)

Dividend Discount Models (DDM)

Description

Calculate the value of a common stock from discounted dividends, by employing (1) Zero Growth Model, (2) Gordon's Model, (3) Differential Growth Model.

Usage

ddm(DIV,RETURN,G1,G2,PER)

Arguments

DIV

Dividend at period 0 (Numeric variable).

RETURN

Required return of the investor (Numeric variable).

G1

Expected growth rate (Numeric variable) - Optional (Essential for Gordon's model & the differential growth model).

G2

Expected growth rate after the period of change (Numeric variable) - Optional (Essential for the differential growth model).

PER

Period at which the growth rate changes (Numeric variable) - Optional (Essential for the differential growth model).

Details

For the Zero Growth Model, fill in DIV and RETURN; for Gordon's Model, include DIV, RETURN, and G1; and for the Differential Growth Model, provide DIV, RETURN, G1, G2, and PER.

Value

A data.frame presenting the model employed and the stock's value based on discounted dividents.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

Jordan, B. D., Ross, S. A., and Westerfield, R. W. (2010). Fundamentals of corporate finance. McGraw Hill. p. 234-240 - ISBN: 9780073382395

Examples

##
# Example usage

#Company pays a dividend of 3 currency units per share
#Investors require a return of 8%

example <- ddm(
  DIV = 3, # Dividend Amount in currency units
  RETURN = 0.08 # Required Return of the investor
)

print(example)

#Company pays a dividend of 0.8 currency units per share
#Investors require a return of 10%
#The dividend is expected to grow at a constant rate of 4%

example2 <- ddm(
  DIV = 0.8, # Dividend Amount in currency units
  RETURN = 0.10, # Required Return of the investor
  G1 = 0.04 # Growth rate
)

print(example2)

#Company pays a dividend of 2 currency units per share
#Investors expect a return of 12%
#The dividend is projected to grow at 8% for the first 3 years
#Then at 4%

example3 <- ddm(
  DIV = 2, # Dividend Amount in currency units
  RETURN = 0.12, # Required Return of the investor
  G1 = 0.08, # Growth rate
  G2 = 0.04, # Growth rate after PER
  PER = 3 # Growth rate change happens in Period 3
)

print(example3)

Price & Macaulay Duration of a Fixed Income Security

Description

Calculate discounted cash flows of a bond's coupon payments and its sensitivity to interest rate change.

Usage

fis(FV,CR,YTM,MAT,SEMI)

Arguments

FV

Face value of the bond (Numeric Variable).

CR

Coupon rate of the bond (Numeric Variable).

YTM

Yield to maturity (Numeric Variable).

MAT

Maturity in years (Numeric Variable).

SEMI

Select between annual or semi-annual coupon payments (default is annual).

Details

The default option is annual coupon payments. To select semi-annual payments, set SEMI = TRUE.

Value

A data.frame with the results of the financial instrument's price in currency units, its duration and modified duration in years.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

Jordan, B. D., Ross, S. A., and Westerfield, R. W. (2010). Fundamentals of corporate finance. McGraw Hill. p. 193-202. - ISBN: 9780073382395

Berk, J. B. and DeMarzo, P. M. (2017). Corporate finance. Pearson Education. p.205-220 & p.1073-1074 - ISBN: 1292160160

Examples

##
# Example usage

# Face value = 1,000 currency units
# Coupon rate = 8%
# Yield to maturity = 8%
# Maturity = 6 years

example <- fis(
  FV = 1000, # Bond with face value of 1.000 currency units
  CR = 0.08, # 8% Coupon rate
  YTM = 0.08, # 8% Yield to maturity
  MAT = 6 # 6 periods to maturity
)

print(example)

# Face value = 1,000 currency units
# Coupon rate = 8%
# Yield to maturity = 12%
# Maturity = 2 years
# Coupons pay semi-annually

example2 <- fis(
  FV = 1000, # Bond with face value of 1.000 currency units
  CR = 0.08, # 8% Coupon rate
  YTM = 0.12, # 8% Yield to maturity
  MAT = 2, # 6 periods to maturity
  SEMI = TRUE
)

print(example2)

Net Present Value (NPV) and Internal Rate of Return (IRR) of an investment

Description

Basic investment decision methods: (1) Net Present Value (NPV), (2) Internal Rate of Return (IRR).

Usage

idm(CFS,COST)

Arguments

CFS

A numerical vector with the investment's expected cash flows.

COST

A numerical vector with the investment's expected cost of capital (interest rates).

Details

The first cash flow must be the initial cost of investment, thus a negative value. Cash flows and interest rates must have the same length.

Value

A data.frame with the investment decision methods and their respective values.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

Berk, J. B. and DeMarzo, P. M. (2017). Corporate finance. Pearson Education. p.100-103 & p.248-251 - ISBN: 1292160160

Ehrhardt, M. C. and Brigham, E. F. (2010). Corporate finance: A focused approach. South-Western Cengage Learning. p. 383-389 - ISBN: 1439078084

See Also

uniroot

Examples

##
# Example usage
# Initial Investment = 100 currency units
# Expected to bring 120 currency units the next period
# The cost of capital is 10%

example <- idm(
  CFS = c(-100,120),
  COST = c(0,0.1)
)

print(example)

P & L Key Performance Indicators (KPIs)

Description

Calculate income statement ratios: (1) Gross Profit Margin, (2) Net Profit Margin, (3) Earnings Per Share (EPS), (4) Price to Earnings (P/E) Ratio.

Usage

insta(REV,COS,NET,PREF,SHARES,PPS)

Arguments

REV

Revenue (Numeric Variable).

COS

Cost of Sales (Numeric Variable).

NET

Net Income (Numeric Variable).

PREF

Amount of Preferred Stock Dividend (Numeric Variable) - Optional (Essential for the calculation of EPS & P/E Ratio).

SHARES

Number of Shares (Numeric Variable) - Optional (Essential for the calculation of EPS & P/E Ratio).

PPS

Price per Share (Numeric Variable) - Optional (Essential for the calculation of P/E Ratio).

Value

A data.frame with the 4 ratios and their respective values.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

Hayes A. (2024). Profitability Ratios: What They Are, Common Types, and How Businesses Use Them. https://www.investopedia.com/terms/p/profitabilityratios.asp

Picardo E. (2024). P/E Ratio vs. EPS vs. Earnings Yield: What's the Difference? https://www.investopedia.com/articles/investing/120513/comparing-pe-eps-and-earnings-yield.asp

Examples

##
# Example usage
example <- insta(
  REV = 25000000, # Revenue
  COS = 19850000, # Cost of Sales
  NET = 1000000, # Net Income
  PREF = 100000, # Preferred Stock Dividend
  SHARES = 100000, # Number of Shares
  PPS = 120 # Price per Share
)

print(example)

Loan Payments & Debt Management

Description

Calculate the installments, interest, principal and debt balance for each period of a loan.

Usage

loan(AMOUNT,RATE,PER)

Arguments

AMOUNT

Amount of the loan (Numeric Variable).

RATE

Loan's periodic interest rate (Numeric Variable).

PER

Periods to maturity (Numeric Variable).

Value

A list with 2 data.frames: (1) Summary, presenting the installment and the repayment amount. (2) Amortization Table for all periods of the loan until maturity.

Author(s)

Pavlos Pantatosakis.

R implementation and documentation: Pavlos Pantatosakis [email protected].

References

Ehrhardt, M. C. and Brigham, E. F. (2011). Corporate finance: A focused approach. South-Western Cengage Learning. p. 156-160 - ISBN: 1439078084

See Also

idm

Examples

##
# Example usage
example <- loan(
  AMOUNT = 100000, # 100.000 currency units loan
  RATE = 0.05, # 5 % periodic interest
  PER = 4 # 4 periods to maturity
)

print(example)

# Another example

example2 <- loan(
  AMOUNT = 1000, # 1.000 currency units loan
  RATE = 0.20, # 20 % periodic interest
  PER = 3 # 3 periods to maturity
)

print(example2$AmortizationTable) # For amortization table
print(example2$AmortizationTable[5]) # Balance for each period