<- readRDS("balance_df.rds")
balance_df <- readRDS("income_df.rds")
income_df
# balance_df (actual calcs below)
#
# balance_df: Calculated Variables (7) as pulled from 10Q
# Total Debt Securities (TotDebtSec): Sum of Trading, Available-for-Sale, and Held-to-Maturity Debt Securities.
# Net Loans (NetLoans): Loans plus Allowance for Loan Losses.
# Total Deposits (TotDep): Sum of Noninterest-Bearing and Interest-Bearing Deposits.
# Total Liabilities (TotLiab): Sum of Total Deposits, Short-Term Borrowings, Derivative Liabilities,
# Accrued Expenses and Other Liabilities, and Long-Term Debt.
# Total Shareholders' Equity (TotSHREq):Sum of Preferred Stock, Common Stock, Additional Paid-In Capital,
# Retained Earnings, Accumulated Other Comprehensive Loss, Treasury Stock,
# Unearned ESOP Shares, and Noncontrolling Interests.
# Total Assets (TotAssets): Sum of all asset accounts plus Total Liabilities and Equity.
# Total Liabilities and Equity (TotLiabEq):Sum of Total Liabilities and Total Shareholders' Equity.
#
# balance_df: Calculated Variables (7) with shorter names
# balance_df$TotDebtSec <- balance_df$TradDebtSec + balance_df$AvailSaleDebtSec + balance_df$HeldMatDebtSec
# balance_df$NetLoans <- balance_df$Loans + balance_df$LoanLossAllow
# balance_df$TotDep <- balance_df$NonIntBearDep + balance_df$IntBearDep
# balance_df$TotLiab <- balance_df$TotDep + balance_df$STBorrow + balance_df$DerivLiab + balance_df$AccExpOthLiab +
# balance_df$LTDebt
# balance_df$TotSHREq <- balance_df$PrefStock + balance_df$ComStock + balance_df$AddlPaidCap + balance_df$RetEarn +
# balance_df$AOCL + balance_df$TreasStock + balance_df$UnearnESOP + balance_df$NonCtrlInt
# balance_df$TotAssets <- balance_df$Cash + balance_df$IntEarnDep + balance_df$FedFundsSold + balance_df$TotDebtSec +
# balance_df$LoansForSale + balance_df$NetLoans + balance_df$MortServRights + balance_df$PremEquip +
# balance_df$Goodwill + balance_df$DerivAssets + balance_df$EquitySec + balance_df$OthAssets +
# balance_df$TotLiabEq <- balance_df$TotLiab + balance_df$TotSHREq
#
# balance_df: Input Variables (4)
# Loans (Loans)
# Allowance for Loan Losses (LoanLossAllow)
# Noninterest Bearing Deposits (NonIntBearDep)
# Interest Bearing Deposits (IntBearDep)
#
# balance_df: Drift Variables
# Cash (Cash)
# Interest Earning Deposits (IntEarnDep)
# Federal Funds Sold (FedFundsSold)
# Trading Debt Securities (TradDebtSec)
# Available-for-Sale Debt Securities (AvailSaleDebtSec)
# Held-to-Maturity Debt Securities (HeldMatDebtSec)
# Loans Held for Sale (LoansForSale)
# Mortgage Servicing Rights (MortServRights)
# Premises and Equipment (PremEquip)
# Goodwill
# Derivative Assets (DerivAssets)
# Equity Securities (EquitySec)
# Other Assets (OthAssets)
# Short-Term Borrowings (STBorrow)
# Derivative Liabilities (DerivLiab)
# Accrued Expenses and Other Liabilities (AccExpOthLiab)
# Long-Term Debt (LTDebt)
# Preferred Stock (PrefStock)
# Common Stock (ComStock)
# Additional Paid-In Capital (AddlPaidCap)
# Retained Earnings (RetEarn)
# Accumulated Other Comprehensive Loss (AOCL)
# Treasury Stock (TreasStock)
# Unearned ESOP Shares (UnearnESOP)
# Noncontrolling Interests (NonCtrlInt)
#
#
# income_df
#
# income_df: Calculated variables (10)
# income_df$TotIntInc <- income_df$DebtSec + income_df$LoansSale + income_df$Loans + income_df$EqSec + income_df$OthIntInc
# income_df$TotIntExp <- income_df$DepIntExp + income_df$STBIntExp + income_df$LTBIntExp + income_df$OthIntExp
# income_df$NetIntInc <- income_df$TotIntInc - income_df$TotIntExp
# income_df$TotnonIntInc <- income_df$DepLendFees + income_df$InvAdvFees + income_df$CommBrkFees + income_df$InvBankFees +
# income_df$CardFees + income_df$MortBank + income_df$NetGainTrade + income_df$OthNonIntInc
# income_df$TotRev <- income_df$NetIntInc + income_df$TotNonIntInc
# income_df$TotNonIntExp <- income_df$Personnel + income_df$TechTelEquip + income_df$Occupancy +
# income_df$OperLoss + income_df$ProfOutServ +
# income_df$AdvPromo + income_df$OthNonIntExp
# income_df$IncBefTax <- income_df$TotRev - income_df$TotNonIntExp - income_df$ProvCredLoss
# income_df$NetIncBefNCI <- income_df$IncBefTax - income_df$TaxExp
# income_df$WFNetInc <- income_df$NetIncBefNCI - income_df$NetIncLossNCI
# income_df$WFNetIncCS <- income_df$WFNetInc - income_df$PrefStkDiv
#
#
# income_df: Input Variables (6) ... directly impacted by external macroeconomic changes and focus in stress test scenarios
# Loans (Loans): Total amount of loans issued, sensitive to economic changes affecting credit demand and default rates.
# Equity Securities (EqSec):Investments in equity securities, influenced by market valuations and economic conditions.
# Other Interest Income (OthIntInc): Income generated from various miscellaneous financial sources, potentially sensitive to
# interest rate changes and economic conditions.
# Provision for Credit Losses (ProvCredLoss): Reserves set aside to cover potential loan defaults, directly impacted by
# economic conditions and credit risk assessments.
# Deposits Interest Expense (DepIntExp): Cost incurred from interest on deposits, which fluctuates with interest rate
# changes.
# Mortgage Banking (MortBank): Income from mortgage-related activities, which can vary significantly with housing market
# conditions and interest rates.
#
# income_df: Drift Variables
# Debt Securities (DebtSec): Typically more stable investments unless significantly impacted by interest rate changes or
# credit quality adjustments.
# Loans Held for Sale (LoansSale): Loans intended for sale in the near term, might not be directly impacted by long-term
# economic trends.
# Short Term Borrowings Interest Expense (STBIntExp): Costs associated with short-term borrowings, which could have fixed
# rates or short adjustment periods.
# Long Term Debt Interest Expense (LTBIntExp): Costs related to long-term borrowings, which may be fixed or less sensitive
# to immediate market fluctuations.
# Other Interest Expense (OthIntExp): Miscellaneous interest expenses that may not directly correlate with macroeconomic
# Deposit Lending Related Fees (DepLendFees): Fees associated with deposit accounts and lending services, relatively stable
# and less directly impacted by macro conditions.
# Investment Advisory & Other Asset-Based Fees (InvAdvFees): Fees earned from managing client assets, depending on market
# conditions but also on contractual arrangements.
# Commissions & Brokerage Services Fees (CommBrkFees): Fees from brokerage and trading services,
# somewhat dependent on market activity levels.
# Investment Banking Fees (InvBankFees): Revenue from investment banking activities, which can fluctuate with
# market conditions but are also driven by deal flow.
# Card Fees (CardFees): Fees associated with credit and debit card usage, generally stable unless consumer spending
# habits change significantly.
# Net Gains from Trading Securities (NetGainTrade): Profits from trading activities, highly variable but also dependent
# on trading strategies and market conditions.
# Other Noninterest Income (OthNonIntInc): Diverse sources of income not classified elsewhere, potentially variable
# but not directly linked to macroeconomic stressors.
# Personnel (Personnel): Employee-related expenses, relatively fixed in the short term.
# Technology, Telecommunications, and Equipment (TechTelEquip): Expenses related to technology and equipment,
# typically follow planned investment patterns.
# Occupancy (Occupancy): Costs associated with physical premises, largely fixed.
# Operating Losses (OperLoss): Losses from operational issues, not directly linked to economic conditions.
# Professional and Outside Services (ProfOutServ): Costs for external services, can vary with business activity
# but not directly tied to economic stressors.
# Advertising and Promotion (AdvPromo): Marketing and advertising costs, generally discretionary.
# Other Noninterest Expense (OthNonIntExp): Miscellaneous expenses not categorized elsewhere
# Income Tax Expense (TaxExp): Taxes on profits, varies with earnings but not directly impacted by most macroeconomic
# Net Income Loss from Noncontrolling Interests (NetIncLossNCI): Earnings attributed to noncontrolling interests,
# varies based on subsidiary performance.
# Preferred Stock Dividends and Other (PrefStkDiv): Dividends and similar payments to preferred shareholders,
# typically fixed based on issuance terms.
#
# *summary:*
# balance_df
# Total Variables: 36
# Calculated Variables: 7
# Input Variables: 4
# Drift Variables: 36 - 7 - 4 = 25
#
# income_df
# Total Variables: 38
# Calculated Variables: 10
# Input Variables: 6
# Drift Variables: 38 - 10 - 6 = 22
# Transpose dataframes
<- t(balance_df)
balance_df_t <- as.data.frame(balance_df_t)
balance_df_t <- t(income_df)
income_df_t <- as.data.frame(income_df_t)
income_df_t
print("Balance Sheet Dataframe:")
[1] "Balance Sheet Dataframe:"
print(balance_df_t)
2022 2023
Cash 34596 33026
IntEarnDep 124561 204193
FedFundsSold 68036 80456
TradDebtSec 86155 97302
AvailSaleDebtSec 113594 130448
HeldMatDebtSec 297059 262708
TotDebtSec 496808 490458
LoansForSale 7104 4936
Loans 955871 936682
LoanLossAllow -12985 -14606
NetLoans 942886 922076
MortServRights 10480 8508
PremEquip 8350 9266
Goodwill 25173 25175
DerivAssets 22774 18223
EquitySec 64414 57336
OthAssets 75838 78815
NonIntBearDep 458010 360279
IntBearDep 925975 997894
TotDep 1383985 1358173
STBorrow 51145 89559
DerivLiab 20067 18495
AccExpOthLiab 68740 71210
LTDebt 174870 207588
TotLiab 1698807 1745025
PrefStock 19448 19448
ComStock 9136 9136
AddlPaidCap 60319 60555
RetEarn 187968 201136
AOCL -13362 -11580
TreasStock -82853 -92960
UnearnESOP -429 0
NonCtrlInt 1986 1708
TotSHREq 182213 187443
TotAssets 1881020 1932468
TotLiabEq 1881020 1932468
print("Income Statement Dataframe:")
[1] "Income Statement Dataframe:"
print(income_df_t)
2021 2022 2023
DebtSec 9253 11781 16108
LoansSale 865 513 363
Loans 28634 37715 57155
EqSec 608 707 682
OthIntInc 334 3308 10810
TotIntInc 39694 54024 85118
DepIntExp 388 2349 16503
STBIntExp -41 582 3848
LTBIntExp 3173 5505 11572
OthIntExp 395 638 820
TotIntExp 3915 9074 32743
NetIntInc 35779 44950 52375
DepLendFees 6920 6713 6140
InvAdvFees 11011 9004 8670
CommBrkFees 2299 2242 2375
InvBankFees 2354 1439 1649
CardFees 4175 4355 4256
MortBank 4956 1383 829
NetGainTrade 7264 1461 4368
OthNonIntInc 4408 2821 1935
TotNonIntInc 43387 29418 30222
TotRev 79166 74368 82597
ProvCredLoss -4155 1534 5399
Personnel 35541 34340 35829
TechTelEquip 3227 3375 3920
Occupancy 2968 2881 2884
OperLoss 1568 6984 1183
ProfOutServ 5723 5188 5085
AdvPromo 600 505 812
OthNonIntExp 4131 3932 5849
TotNonIntExp 53758 57205 55562
IncBefTax 29563 15629 21636
TaxExp 5764 2251 2607
NetIncBefNCI 23799 13378 19029
NetIncLossNCI 1690 -299 -113
WFNetInc 22109 13677 19142
PrefStkDiv 1291 1115 1160
WFNetIncCS 20818 12562 17982