Design of a Rule-based Personal Finance Management System based on Financial Well-being

Financial planning plays an important role in people’s lives. The recent COVID-19 outbreak has caused sudden unemployment for many people across the globe, leaving them with a financial crisis. Recent surveys indicate that financial matters continue as the leading cause of stress for employees. Further, many millennials overspend and make unfortunate financial decisions due to their incapability to manage their earnings, which forbids them from maintaining financial satisfaction. Financial well-being as defined by The American Consumer Financial Protection Bureau (CFPB) is a state where one fully meets current and ongoing financial obligations, feels secure in their financial future, and is able to make choices to enjoy life. This work proposes a Personal Finance Management (PFM) system with a new architecture that aims to guide users to reach the state of financial well-being, as defined by CFPB. The proposed system consists of a rule-based system that provides users with actionable advice to make informed spending decisions and achieve their financial goals. Keywords—Artificial intelligence; rule-based; deductive reasoning; forward chaining; personal finance; financial wellbeing

INTRODUCTION Money plays a crucial role in people's lives. Managing one's financial life can be challenging due to the increased commitments and spending, hence it may become difficult to achieve the desired financial goals. An employee financial wellness survey that took place in USA in 2020 revealed that 54% of stress is caused by financial matters, and 41% of millennials are unprepared for unexpected expenses [1]. In Saudi Arabia, a recent survey suggests that the average family expenditure is greater than the average family income [2]. Making conscious financial decisions plays a key role in financial well-being. According to Zaltman [3], however, 95% of purchase decisions that people make every day are subconscious. The author suggests that purchase behavior are driven by emotions, and hence may not be logical. Therefore, one may decide to purchase an item as long as he has money to pay for, without considering his overall financial state and future commitments.
The American Consumer Financial Protection Bureau (CFPB) defined financial well-being as "a state of being wherein a person can fully meet current and ongoing financial obligations, can feel secure in their financial future, and is able to make choices that allow enjoyment of life" [4]. Further, the CFPB identified four main elements of financial well-being, as follows: 1) Having control over day-to-day, month-to-month finances.
2) Having the capacity to absorb a financial shock.
3) Having the financial freedom to make the choices that allow one to enjoy life.

4)
Being on track to meet your financial goals. [4].
As shown in Fig. 1, these elements span over two dimensions; time (future or present) and goal (security or freedom of choice). The first and second elements pertain securing the present and future, respectively, and the third and fourth elements pertain having freedom of choice in the present and future, respectively [4]. An individual who has control over daily and monthly finances is able to pay bills and all periodical expenses with no delay. Also, an individual, who has the capacity to absorb financial shock, owns personal savings that enable him to deal with future emergencies. One who has the freedom to make financial choices can afford not only what they need but also what they want. Finally, someone who is on track to achieve financial goals has a financial plan and continuously making progress toward achieving their financial goals. The aforementioned elements of financial well-being represent the privileges that an individual who reached the state of financial well-being enjoys. However, they do not define how someone may reach that state. In other words, the elements do not answer the question: what are the main practices that one should strive to do in order to reach financial well-being? Many Personal Finance Management (PFM) software are available, but none was designed with the definition of financial well-being in mind, and hence are unable to guide the user to reach the state of financial wellbeing. This work seeks to fill this gap by proposing three practices and a new architecture for PFM that guides users to adopt them.
The remainder of this paper is organized as follows. Section 2 reviews related work in PFM and financial wellbeing. Section 3 explains the system model, while Section 4 explains the proposed rule-based system. Finally, a summary with concluding remarks are provided in Section 5.
Money pro [10] and Qapital [15] offer some unique and exclusive features. The former show the user not only the current balance, but also his expected balance after paying off all periodical expenses. The latter allows the user to set up customized rules, such as save part of the paycheck automatically each payday or save an amount when you buy what you are trying to resist.
Although many PFM software are available, none was designed with the definition of financial well-being in mind, and hence are unable to guide the user to reach the state of financial well-being for several reasons. First, existing software do not provide actionable advice to users. This is important especially due to the fact that majority of users' purchase decisions are subconscious. Second, some users may have ambitious saving goals that might not fit his financial state, and hence cannot maintain and make progress toward it. This may impact the user's overall attitude toward saving. Further, majority of existing software requires the user to enter every transaction manually, which is not practical.

A. Definitions
The system uses the following terms.
 Inflow: Money going into the bank account.
 Outflow: Money going out of the bank account.
 Periodical expenses: Monthly outflow transactions such as bills and rent.
 Budget: Amount of money saved once and available to spend for a specific purpose with no time frame.
 Saving amount: Amount of money to be saved in monthly installments.
 Saving installment: a monthly amount to be paid toward a saving goal.
 Saving plan: A long-term or short-term plan to save a specific amount of money within a time frame.
 Commitments: the total amount of the user's periodical expenses, saving installments, debts monthly installment, and current budgets.
 Balance: Total amount of money available in the bank accounts.
 Available balance: Amount of money remained after deducting commitments.

B. Financial Well-being Inspiration
As mentioned previously, the definition and elements of financial well-being proposed by CFPB only represent the privileges that one who reached the state of financial wellbeing enjoys. However, they do not define the main practices that one should strive to do in order to reach financial wellbeing.
The main goal of this work is to inspire and guide users to reach a state of financial well-being, as defined by CFPB. Therefore, based on the definition and elements of financial well-being mentioned previously, we propose three main www.ijacsa.thesai.org principles that a PFM must follow in order help users reach financial well-being. A PFM shall: 1) Build experience by making users aware of their financial activities such as how much they spend or earn over a specific period of time.
2) Provide insights into user's finances, i.e. how much, when, and where they spend their money.
3) Help users with actionable advice to achieve their financial goals.
The first principle is inspired by the first element of financial well-being, i.e. having control over day-to-day, month-to-month finances. As explained previously, this principle denotes that one is able to pay bills and all periodical expenses with no delay. We argue that one must be first aware of such periodical expenses and their total cost, even before they are paid or deducted from the account. Therefore, allowing the user to set up periodical expenses is an essential requirement for PFM. Further, we propose that periodical expenses are to be deducted from the balance on payday, hence one is well aware of how much he really own, shown in the available balance. These periodical expenses include rent, bills, saving installment, and loan installment. Showing the available balance after deducting periodical expenses supports the third element of financial well-being, i.e. having the financial freedom to make the choices that allow one to enjoy life. Since saving installment is included in the periodical expenses, this principle also supports the forth element, which is being on track to meet one's financial goals.
The second principle focuses on allowing the user to understand his/her financial behavior. In PFM, this can be achieved by categorizing user's transactions automatically and providing different types of charts that convey spending trends and informative insights. Therefore, the user can see when and what he/she spends his money the most on, which enables him to adjust his behavior to reduce spending. This principle can indirectly contribute the third element of financial well-being that is having the financial freedom to make the choices that allow one to enjoy life. Moreover, based on these insights, a PFM shall be able to evaluate the user's financial performance, i.e. on track or over budget.
The third principle consists of two sub-principles: saving principle and advice principle. The former suggests that a PFM system shall allow the user to set up a saving goal and a saving plan. This supports the forth element of financial well-being by keeping the user on track to achieve financial goals and continuously making progress toward achieving their financial goals. It also supports the second principle since the user may set up a saving goal for emergency, hence is able to absorb financial shock. The latter sub-principle signifies that a PFM shall also advice the user on different financial issues. For instance, a user may have an overambitious saving goal, which does not fit his current financial situation. Therefore, the user may fail in maintaining and making progress toward it. This may impact the user's overall attitude toward saving if he fails in his first saving plan. Therefore, a PFM shall advice the user on the saving plan and further recommend one that fits his financial state. This support the second and forth principles. A PFM shall also advice the user on purchasing decisions, since as explained previously, most of them are subconscious, which supports the third principle.

C. System Architecture
The main goal of this work is to design a PFM system that helps users maintain a healthy financial life and guide them to reach the state of financial well-being. The proposed system uses Artificial Intelligence to achieve this goal and consists of three main modules; awareness module, insight module, and advice module, as shown in Fig. 2. Each module corresponds to one of the proposed principles in the previous sub-section. The following points explain each module in further details.

1) Awareness Module:
This module supports the first proposed principle; that is to build experience by making users aware of their financial activities such as how much they spend or earn over a specific period of time. This is achieved by offering the following features:  Tracking user's financial activities (inflow and outflow transactions) automatically by either accessing the SMS messages sent for each transaction or synching with the user's bank account to add the corresponding transactions.
 Allow users to track their spending over a customized period of time, e.g. month or week.
 Allow users to set up periodical expenses.
 Deduct periodical expenses on payday and show both actual balance and available balance.

2) Insight Module:
This module supports the second principle, which is to provide insights into user's finances, i.e. how much, when, and where they spend their money. Th following features are provided by this module:  Categorize transactions automatically by vendor, location, and time/day to help discover user's spending patterns.
 Allow the user to create custom categories such as education, food, and medical where transactions fall into.
 Create a dashboard for visualizing the user's financial performance using different types of charts.
 Monitor and notify the user of his/her financial performance, i.e. on track or over budget. The aim is to help low-income users avoid situations where they spend most of his income when it is first received, which leaves them with no enough money for the rest of the month, and also help high-income users avoid situations where they spend too much on unnecessary things by setting a limit to his/her spending. www.ijacsa.thesai.org 3) Advice Module: The advice module facilitates the realization of the third principle, which suggests that a PFM shall help users with actionable advice to achieve their financial goals. This module consists of two main submodules:  Spending advice sub-module, where the user can ask the system if he should spend a specific amount of money on an item.
 Saving advice sub-module, where the user may ask about the feasibility of a saving plan, given the amount and target duration of time.
In addition, this module suggests an alternative plan if the current plan is not feasible, by increasing the target duration of time or reducing the target amount of money to be saved. Therefore, the module creates a saving plan according to the user's current financial status and also allows the user to track its progress.
In this work, Rule-Based Reasoning, specifically Forward Chaining, is used to design the two advice sub-modules included in this module. In the sections below, we present the proposed rule-based system for this purpose.

IV. RULE-BASED SYSTEM
Reasoning is a form of deductive learning where rules are provided to the system by a domain expert and the system then reasons about individual cases using the provided rules. Rulebased reasoning relies on facts and rules to solve problems. Deductive reasoning is defined as "the process of inferring conclusions from known information (premises) based on formal logic rules" [20]. The system can use user's information such as his transactions and his standard of living to suggest a spending lifestyle for the user. There are mainly two inference methods; forward chaining and backward chaining. In this work we use Forward Chaining, which starts from then given facts and uses inference rules to produce more facts until the goal is proven.
As shown in Fig. 3, the main component of a rule based system is rule set, working memory, and inference engine. The rule set contains the rules, which will be explained in the following sub-sections. The working memory includes the facts used by the rules and intermediate results. The inference engine is in charge of performing the forward chaining. The inference starts with matching the rules set with the known facts in the working memory. If there are rules to match, the engine selects a rule and matches its antecedents (left-hand side) with the assertions (facts in working memory) and substitute any variables.
If the match succeeds, the rule is fired and variables in the rule's consequences (right-hand side) are substituted. Then, the result conclusions are added to the patterns. When all rules are matched, the inference engine adds all patterns, if any, to the working memory. If the working memory is updated, another cycle of inference will be performed. This continues until the working memory is not updated after an inference cycle.
In the sub-sections below, we present the proposed rules set for both the spending advice and saving advice components.

A. Saving Advice
This component allows the user to find out if he/she can afford a specific saving goal. The user enters the amount he wants to save (AMOUNT), the saving duration (DUR). The system analyzes the entered values according to the user's financial situation and determines whether the saving goal is feasible or not feasible using the rule-based system explained below.
If the goal is not feasible, the system suggests other feasible saving plans by increasing the value of parameter DUR or decreasing AMOUNT. The proposed solution to give a saving advice to the user works as follows. The available user's balance (BALANCE) from which the MAMOUNT will be deducted from is calculated as the subtraction of the total commitments from the current balance, as in Eq. (2).
where: INCOME = The user's total income COMMIT = the total amount of the user's total saving plans, current periodical expenses, budgets, and debts.
The values MAMOUNT and BALANCE will be compared as shown in the rule set in Table I.

B. Spending Advice
The spending advice enables the user to ask whether he/she should buy an item. The user enters the price of the item (PRICE), choose whether it is necessary or not. The system infers whether the purchase is needed, advisable, not worth it, or troublesome, according to rule-based system described below.
First, the available balance for the user (ABALANCE) is the current balance of the user (BALANCE) deducted from it the total commitments (COMMIT) associated with the user account, as shown in Eq. (3) below.
where: BALANCE = The current balance of the user COMMIT = The total amount of the user's total saving plans, current periodical expenses, budgets, and debts.
The system then reasons about the whether the item should be purchased, according to the rule set shown in Table II.

R3
The user cannot afford the purchase & the item is necessary The purchase is needed & An emergency budget is created by allowing the user to reduce amount allotted to one or more future commitment for the current month, i.e. periodic, budget, or saving plan.

R4
The user cannot afford the purchase & the item is not necessary The purchase is troublesome

R5
The user affords the purchase & the item is necessary The purchase is advisable

R6
The user affords the purchase & the item is not necessary & PRICE_INCOME_PER >10 The purchase is not worth it

V. CONCLUSION
The main goal of this work was to propose a personal finance management system with new architecture that builds on the fundamental principles of financial well-being as defined by the American Consumer Financial Protection Bureau (CFPB). This work has presented the main components of the system architecture and how they guide users to adopt financial practices that help them reach the state of financial well-being. Further, we proposed a rule-based system that provides spending and saving advice that enable the user to make informed spending decisions and achieve their financial goals.

ACKNOWLEDGMENT
The author would like to thank Ghaida Alshdokhi, Shahad Aljubayri, Hala Alntifat, and Nora Alqahtani for their help with this work.