Posts

Round Two

The President enjoys a good fight.  The only question is will there be an opponent.  Reality, of course, is one major opponent.  But, the Presidents seems adept at ignoring reality.  The State of the Union speech last night was the Hugo Chavez plan for the US -- more body slams to the private sector, more money to be wasted on government and government's pals.  As for the poor, raise the minimum wage.  One wonders why Obama did not advocate a $ 100 per hour minimum wage.  Using his logic, that should solve the problem of poverty in one grand stroke. As for the hopes of the unemployed and underemployed, forget it.  This President is not bothered by slack economic growth and growing numbers of folks disappearing from the work force.  Just expand medicaid and food stamps.  That should do it. As for the national debt.  Hey!  That's one area where we lead the world.  Let's maintain that lead! Meanwhile, the war on capitalism co...

Our New Website!

Image
Visit our new website to learn about us and check future events! http://nyufinancesociety.com

The Snow Storm Disaster

As three feet of snow blanket Boston, the Administration tries to push their "climate change" agenda, as if anything of substance could result from that.  There is no scientific evidence that weather patterns are changing materially, but that doesn't keep the Obama folks from pointing to every weather-related problem as more evidence of climate change. One wonders why the infrastructure in America is not built up to withstand these storms and help the public resist them.  The answer?  There is no money left.  The liberal agenda, mainly the entitlements, have not only taken top priority, but will eventually absorb more than any possible tax revenues could ever provide. One of the many downsides of the entitlement world is much, much slower economic growth.  Entitlements destroy private savings, reduce and eliminate work incentives, and make personal responsibility a remnant of antiquity.  A record number of Americans now live off of social security disabilit...

C++ - Coding - Deterministic Coupon Bond Pricer

Question You must price a coupon bond with a principle of $100 maturing in 2 years time. Two coupons of $5 are paid at the end of year one and year two, and the continuous compound interest rate is a constant 10%. Extend your code to price a coupon bond with any specification. The aim of this is to create a step by step approach to coding up a coupon bond so that it can accept any number of coupons, interest rate, maturity, time, principle or coupon value. This is not as easy as it sound and we need to consider what the effect of letting different parameters vary can have on our code. First we start by declaring the variables and parameters in the problem. Differentiating between the two is not essential here but for more advanced coding this difference does become important. In this problem only time is variable (since we assume interest rates are constant). We are going to specify the number of coupons paid out per year to be an integer or in other words a number that we can cou...

C++ - Coding Black Scholes Formula

Image
Question: Write a function to calculate the value of a call option using the Black-Scholes formula given by where To complete this task we will need to use the normal distribution function as demonstrated on the previous post . So rather than starting with an empty project copy and paste the code from the previous project into your new project, you can find a version of the code here . Now we need to create a function for the call option, so we need to think about what arguments need to be supplied and what are the local variables to the function. Obviously we need to supply the asset price, current time both of which may vary, and the parameters for the function are the strike price, interest rate, volatility and maturity, and we want to return a real number as the answer. Inside the function, we will need to calculate the value of d1 and d2. This leads to a function definition of the form double callOptionPrice( double S, double t, double X, double r, double sigma, double...

C++ Examples - Cumulative Normal Distribution Function

Image
Question: Write a function to calculate N(x) the cumulative normal distribution with mean zero and variance one given by the formula Again, first we think about the stages of our program. We must choose a method to implement the integration, test and verify it. Once it is then applied to the problem we need to decide how to deal with the concept of infinity in this setting. First let use code up the integration method. To be able to check the method, you should choose a simple function with a known integral so that we can compare accuracy. Start with a new project and an empty cpp file. #include <iostream> #include <cmath> using namespace std; int main() { return 0 ; } Compile and check it runs. We are going to implement Simpson's method for integration firstly on the sin function so that we can check the results. The method is given by Start by declaring the input parameters required by the method, including the number of steps and the integration range, ...

C++ Examples - Functions Loops

Image
Question: Write a function to calculate sin(x) using the first N terms of the power expansion The idea of this task is to create a simple function making use of loops and eventually a break command to approximate sin(x) with a power series. Yet again I can't emphasise enough how important it is when writing a program that you should always be thinking about the structure and how you are going to stage your calculations. For this particular example, those stages might be:- 1. Include all libraries 2. Declare all variables and assign with default values 3. Create a loop for summing up values 4. Demonstrate ability to calculate each part of expression on each loop 5. Check results against other solutions 5. Move code into a function Give the only libraries you should need are the input/output and mathematical functions your initial program should look like: #include <iostream> #include <cmath> using namespace std; int main() { return 0 ; } Compile and run...