A set of financial equations.
This library provides a set of financial equations. This library is based on the book titled:
El valor del dinero en el tiempo
by Zbigniew Kozikowski Zarska
Add this line to your application's Gemfile:
gem 'financial_math'
And then execute:
$ bundle
Or install it yourself as:
$ gem install financial_math
This cover the next topics in financial math:
- Geometric Progression
- Arithemetic Progression
- Simple Interest
- Compound Interest
More content will be added, soon, like:
- Annuities
- Valuation
- Amortization
- Stock market math
To calculate the last item of a geometric progression:
progression = FinancialMath::GeometricProgression.new(initial_value: 1100, ratio: 1.1, times: 5)
progression.last_item
To calculate the future value:
class Accountant
include FinancialMath::SimpleInterest
end
accountant = Accountant.new
accountant.future_value(present_value: 100_000.0, interest_rate: 0.05, periods: 3)
The interest rate must be in terms of years, if your problem is expressed in terms of days or months, provide the frequency of conversion and the periods in terms of days.
class Accountant
include FinancialMath::SimpleInterest
end
accountant = Accountant.new
accountant.future_value(present_value: 1500.0, interest_rate: 0.45, periods: 3, frequency: 360)
If want test this gem without clone this repo, type:
$ gem install financial_math --dev
This command will get the development dependencies installed too.
- 1.0.3
- FIX: Fix bad release
- 1.0.2
- ADD: Add version badge and fix some typos in README
- 1.0.1
- FIX: Fix bad release
- 1.0.0
- CHANGE: Remove
SimpleInterest()
- CHANGE: Remove
CompoundInterest()
- ADD: Add
CompoundInterest
sub-modules - ADD: Add
SimpleInterest
sub-modules
- CHANGE: Remove
- 0.7.0
- ADD: Add
present_value
,continous_present_value
toCompoundInterest
as public methods - ADD: Add
internal_rate_of_return
,real_rate_of_return
anda_good_investment?
toCompoundInterest
as public methods
- ADD: Add
- 0.6.0
- ADD: Add
@frequency
toSimpleInterest
class - CHANGE: Change the
periods_in_days
mehtod tofactor
inSimpleInterest
- ADD: Add
- 0.5.0
- ADD: Add
average_growth_rate
andcontinous_future_value
public methods toCompoundInterest
class
- ADD: Add
- 0.4.1
- CHANGE: Update docs (module code remains unchanged)
- 0.4.0
- ADD: Add
CompoundInterest
class
- ADD: Add
- 0.3.1
- CHANGE: Update docs (module code remains unchanged)
- 0.3.0
- ADD: Add
SimpleInterest
class
- ADD: Add
- 0.3.0
- ADD: Add
GEometricProgression
class
- ADD: Add
- 0.2.0
- ADD: Add
ArithemeticProgression
class
- ADD: Add
- 0.1.0
- The first proper release
- ADD: The basic file with basic equations
- 0.0.1
- Work in progress
Daniel Omar Vergara Pérez – @dan1_net – daniel.omar.vergara@gmail.com
Bug reports and pull requests are welcome on GitHub at https://github.com/dany2691/financial_math. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
- Fork it (https://github.com/dany2691/financial_math/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the FinancialMath project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.