qplot, easy, pass.

ggplot basics:

1.plot the data

2.overlay a summary

3.metadata and annotation


something you can add on:

facet.grid(. ~ your variable) ____conditional plots

geom_point_____scatter plot

geom_smooth(method=”lm”, linetype, size)______smooth line with confidence interval band

x, ylim(): choose the range of X-Axis and Y-Axis

theme: choose the background

labs: add the titles to it

cut(): quantile(xvariable, seq(0,1,length=10), na.rm=TRUE) ##cut in 9 sections

(new xvariable<- cut(xvariable,your name of the cut function))

difference between mean and response

Mean response:    it’s the inference interval for  E(Y(x)) = B0+B1x+B2x^2

My understanding is, mean response interval is the interval for the estimate mean. It indicates the probability that the mean is in the interval

Prediction interval:  it’s the inference interval Y(x) = B0+B1x+B2x^2+epsilon

is the interval for prediction the real data or population. So it will have the wider range.

About Bond

Some basic definitions first:


the date in the future on which the investor’s principal will be repaid

Face value/Par value/principle:

the amount of money a holder will get back once a bond matures.

Coupon/Interest rate:

the amount the bondholder will receive as interest payments.


yield shows the return you get on a bond.

yield = coupon amount/price, if the price is $1000, coupon rate is 10%, coupon amount is 100$, yield is 10%, but if price goes down to $800, coupon rate goes up to 12.5%

bond price goes up, yield goes down.

More complex def:

Yield To Maturity: yield that hold till the maturity

Bond yield:  bond discounted rate to the maturity

Par Yield:    coupon rate to the maturity


Column 1: Issuer – This is the company, state (or province) or country that is issuing the bond.
Column 2: Coupon – The coupon refers to the fixed interest rate that the issuer pays to the lender.
Column 3: Maturity Date This is the date on which the borrower will repay the investors their principal. Typically, only the last two digits of the year are quoted: 25 means 2025, 04 is 2004, etc.
Column 4: Bid Price – This is the price someone is willing to pay for the bond. It is quoted in relation to 100, no matter what the par value is. Think of the bid price as a percentage: a bond with a bid of 93 is trading at 93% of its par value.
Column 5: Yield – The yield indicates annual return until the bond matures. Usually, this is the yield to maturity, not current yield. If the bond is callable it will have a “c–” where the “–” is the year the bond can be called. For example, c10 means the bond can be called as early as 2010.

Issuing Securities: Primary Securities Market

Issuing Securities: Primary Securities Market


Investment bankers are the underwriters who provide services for the company that want to go public through the process called IPO.

There are two steps of doing that:

  1. Originating: this is the stage where both sides are negotiation with each other. Investment banker attempt to show they are the best for the business and the corporations are testing the investment bank if they fit their needs in the best position(prospectus). The process can be public offering or private placement. Bankers are regulated by SEC(the Securities and Exchange Commission).
  2. Underwriting: this is the stage where the investment bankers enters into an underwriting agreement. The investment bank can earn the profit by two methods: Spread(offer price – price paid by IB) or Best-effort agreement(IB takes commission). For investors, BEA means that bankers are not willing to take the risk to sell the securities because the anticipate some difficulty selling them.

Ok, now what about the companies that want to raise additional funds? Several choices:

  1. used methods discussed above
  2. shelf-registration(allows firms to register security issues with SEC have them available to sell for 2 years): have to meet four requirements, value>150m defaults for past 3 years. 3.BBB or better rate violation of SE act in last 3 years
  3. sell to private party: private placement happens when it meets the requirements that the private party needs to be “Accredited Investors” and they will let the public knows after the takeover happens.
  4. rights offering: existing shareholders have the rights to purchase the new issued stocks first.
  5. seek competitive bids: big and strong companies will allow several investment banking, whoever has the highest price and also shows the ability to have a strong flotation will win the bid. Because it’s easy to imagine companies like Facebook or Google decides to issue new stock, people know it will make money, everyone wants a share, it makes them just easy to choose the best one out of all the IB. (Dutch Auction)

Even though some say that IB shares the big amount of profits, however the undertake risk is huge too. As for example, the leading IB of a syndicate(group of IB) have to take all the left shares when other members of syndicates are gone with selling the securities under the market price.

There are also cost of going public too from the perspective of the issuing company. The firm could have 2 additional costs except for the direct cost like printing expenses, filing fees lawyer’s and accountants fee. First is spread(profit earned by IB), the second is underpricing(after market stock price > offer price) which earned by shareholders. Those 3 are Flotation cost.  Also IPO in US cost about 11% proceeds without underpricing(because the firm didn’t really pull out the money from their pocket).

To attract their clients, investment banking has developed new ways to reduce the underpricing. For example, the involvement of internet can help them with the retail business and treat the customer equal. A individual with higher bid can also get his share before the large investment bank with a lower bid.


The most important exchange in the worldwide is NYSE: New York Stock Exchange. The purpose of it is to providing the facilitates for traders and sellers to make the deals basically.

threare are 3 basic types of members involved: designated market makers(assigned dealer with certain duty to buy certain security), floor brokers(agents trade for customer, take commission as profits), registered traders(buy a seat in NYSE).

Understanding the Transactions: Buying and Selling are the same as buying a car. If you bid an Honda Civic for 10000$, but the seller ask for 12000$, the difference between bid and ask is Spread, the smaller spread the better, the easier the car would be sold. If this car is a stock, it means the stock has more liquidity because it’s easy to trade.

Several Orders:

Limit order: the order is no set until the price drops to 50. max buying price or min selling price

stop loss order(to sell): set a price at certain level to protect the profits, investor set stop loss order at 45$, then if the price drops down to 45$ from 50$, he would sell it

short sale: investor will short sale if he thinks the future stock will decline. And he borrow the street name and sell it in 50$ dollar, and buy stock back at 45$, and you earn 5$. But regulation system like FED and NYSE only allows short sells when the recent price change is increasing, like 40,40,41,42. Because the price is increasing, you can do the short sale in this case. But it can also be risky if the price go up as you didn’t expect!

Buying on Margin: means the investor borrow the money and invest it in the securities.

margin= money that investor pays in cash/ total money including the borrow account from the broker. If a investor borrow 10000$ and combines his own 10000$, his total money is 20000$, his margin is 50%. If the stock he bought increases the price of 10%, he will earn 2000$. If he stops, he will earn 2000$ – the interest he has to pay for the money he borrows.

Gilbert’s Geeky World

This is the first English blog ever for my life.

Gilbert is never being anywhere closer to a geek before, but I’m trying to.

This blog site is targeting for recording everything that I have learned in class or outside the class.

Topics are currently range in but not limited to: R, Statistics, Probabilities, Finance, JAVAscript, SQL.