Modern Pricing of Interest-Rate Derivatives

January 17th, 2008 by kenphang

Modern Pricing of Interest-Rate Derivatives

was troublshooting a piece of code today. found out within a covariance matrix they uses matrix eigen.

http://books.google.com/books?id=Zs4lmuf5MmwC&pg=PA394&lpg=PA394&dq=rebonato+covariance+matrix&source=web&ots=GE5M86-0hB&sig=ypM3R3dhysfwCYV6wYoq4yaF2TM
citeseer.ist.psu.edu/rebonato99most.html

Wake up Malaysia

January 16th, 2008 by kenphang

Keep fighting internally, Malaysian don’t even care about their Country just like me. Yea baby Scandal , Corruption, mis-use of Power , pollution etc …. On word to all bullshit Malaysia govt  stop all this  bullshit try to FIX it else face the consequences of the globalization.

I might not be the right person to say all this but I find that is kinda sad to see my own country going down to the drain like that. Look at Singapore and Vietnam ! Why people rather work in Singapore ? Tell me why man ? To be frank most of the talented people are being taken by Singapore OMFG please Malaysia differentiate between religion and people that can establish global link plus investment ! Stop all this nonsense Lingam , Corruption and cronies.

Let me name you companies that have F*cking lotsa of Malaysian in there !

Sembcorp , singtel , SIA , IBM , NCS , SCS , Banks ! financal organization like CPF which is equivalent to the Malaysia EPF flooed with Malaysian.

One country can’t stand for itself you need connection you need investment  You need vision. You need to embrace procedure that benefit the nation. You need to do it the right way.

GOD BLESS MALAYSIA !

Yea Dr M write whatever you want , condemn Badawi for the past years you have built weaklings in your cabinet. Sack Anwar Ibrahim dictate your own business . Establish your own bread business with your Japanese friend . Tell us did you ever FIX the issue we have in our country ? Did you ever care about all the nation ? Why you always think people come into your country would like to take away your land ? Please look at the F*ucking land we have what sorta of living standard we are at now ? People ask where is this Malaysia jungle ? People ask why your immigration officer wear such badges to remind them Say NO to corruption? Transportation going into the drain what hell did our transportation minister do ? build the largest airport ? for F*uck sake please care about those poor people build GOOD publis transport for them taxi with fare meter , train that goes to the most jam area have quota on vehicle per household.

What happen to the public library ? Send monkey to the space? Spent money on military weapon ? We are moderate islamic country we are commonwealth members we are ASEAN country why we need submarine and fighter planes ? C’mon strengthen your education infrastructure then only you talk about Military infrastructure.

I just hate freaking embarrassment news pop up on BBC, channelnewsasia and etc.

Sex scandal , tourism scandal what else ? C’mon bring it on people I know they choose to stay in Australia and other countries. For f*ck sake STOP all this nonsense

Say hi to SkypeJukeBot

January 1st, 2008 by kenphang

Howdy,

I wrote an amateur python code allow changing and playing music tracks on ubuntu 7.10+ skype4py + skype.  Wow I went to bed took a noon nap and woke up solve the overlapping music track issue. Some unix trick will do it. KILL the process before starting a new track. I just learned python the day before christmas this just a warm up session for my google android project. The real thing that I am going to develop will be starting from today.

Let me walk you through how this program can change music track on your linux system.

1) User A call the bot user.
2) User A invite User B to conference with the bot user.
3) Make sure the bot user’s linux machine has a loopback cable from mic to speaker.
4) On the ubuntu/linux machine install all the relevant stuff to get skype4python to work. DBus, Skype 1.4, Skype4py and etc.
5) Run the python SkypeJukeBot.py the code below.
6) From the party chat dialog window type "Play Track1" or "Play Track2" without the quote and is case sensitive.


import Skype4Py
import time
import os
import datetime

# function on message status
def on_message_status(message, status):
    print status   
    if status == Skype4Py.cmsReceived:
        print message.Body

skype = Skype4Py.Skype()
print "Begin Listening to Skype message"   
now = datetime.datetime.now()
messageReceivedtimeStamp = now
#print " Listener started : "messageReceivedtimeStamp
d = {}
print d
startupFlag =0
while(True):
    if startupFlag == 0:   
        for chat in skype.Chats:
            for message in chat.Messages:
                if message.Id not in d:            
                    d[message.Id] = message.Id
                else:
                    startupFlag =1
                    break
   
    for chat in skype.Chats:
        for message in chat.Messages:
            if message.Id not in d:            
                print message.Id               
                d[message.Id] = message.Id
                print "Skype Message from : " + message.FromHandle
                if message.Body == "Play Track1":
                    print "Music track changed by: " + message.FromHandle
                    print "Playing track 1 music"
                    msg= "Music track changed and playing track 1 "                   
                    for member in message.Chat.MemberObjects:
                                if member.Handle == skype.CurrentUserHandle:
                                    continue # don’t sent to myself
                            skype.SendMessage(member.Handle, msg)
                    os.system(’ps aux|gawk \’$11 == "mplayer" {print $2}\’ > pid.log’)
                    f = open(’pid.log’, ‘r+’)
                    pid = f.read()
                    print pid                   
                    if(pid != ""):                   
                        os.system(’kill -9 ‘ + pid)
                    os.system(’mplayer /home/kenneth/Music/Track1.m4a &’)
                   
                   
                if message.Body == "Play Track2":
                    print "Music track changed by: " + message.FromHandle
                    print "Playing track 2 music"
                    msg= "Music track changed and playing track 2 "                   
                    for member in message.Chat.MemberObjects:
                                if member.Handle == skype.CurrentUserHandle:
                                    continue # don’t sent to myself
                            skype.SendMessage(member.Handle, msg)
                   
                    os.system(’ ps aux|gawk \’$11 == "mplayer" {print $2}\’ > pid.log’)
                    f = open(’pid.log’, ‘r+’)
                    pid = f.read()
                    print pid                   
                    if(pid != ""):                   
                        os.system(’kill -9 ‘ + pid)
                    os.system(’mplayer /home/kenneth/Music/Track2.m4a’)
                   
skype.Attach()

2008 new matrix room !

December 29th, 2007 by kenphang

2008 new matrix room. Today I went to IKEA Tampines did some shopping alone eat hotdog alone carry my new study table alone, take cab back alone. Tidy my room alone clean the room alone. Always wanted a room with study table lotsa computerz and book shelves. U watch dexter lab cartoon ? :) Ohh dear second picture a talking water bottle with a cool microphone and behind the monitor a matrix screensaver.

291207_2128_1

291207_2150

My life with Gaming ended here (2)

November 9th, 2007 by kenphang

Let’s continue from the previous post. I stay at MPH for 4 hours reading a few books before I get my butt home. That person at the counter starred at me, do you know we Malaysian all have thick skin ? Hahahaa I went to confront him told him I was doing some research at school but no cash to buy all this computer books that guy told me no worries go ahead but if his boss is around I need to stop doing that. then I told him no worries if his boss is around I’ll get my ass out of the bookstore. So on that day onwards I always go back to the MPH bookstore to read up on computer related books. Thank god I took 2 months to understand how does a computer work from the head to the toe what is CPU, memory , ROM and etc… Even dont know what the heck is DOS , Disk Operating System IBM and blah blah. MS DOS wa lau all this jargon really kill a secondary school student at my age. At Last I was able to boot my x86 computer with those floppy disk left behind by my dad’s friend I saw some message like MS-DOS 3.3 or something like that then a prompt came up something like A:\_ <blink> <blink> . Then as per norm I went back to the bookstore look for more information.

After all the crash course at the book store I even wrote my own notes on the piece of paperI finally learn a few commands like DIR , EDIT , ctrl+alt+del , MORE TYPE and etc. Even I started to learn QBASIC writing "Hello World" PRINT something … the more I know what can this machine can do I got hooked and keep going back to the bookstore. 

I wrote a program that actually move a blinking cursor in QBASIC. Don’t ask me how did I do it I just got hooked with those syntax and etc start tried and error kinda of learning. I wrote automated menu list files , format floppy disk and etc.. 

My life with Gaming ended here

November 9th, 2007 by kenphang

Some intro how did I get into gaming. During my secondary school I was given a x86 by my dad’s friend. BIG GIGANTIC DINO size computer with a monochrome display(Green black and white display). In fact during my young days I have no interest in any gadget and technology stuff. Well you know people in KL,Malaysia they are all crazy about sports. Badminton and blah blah. I am used to be night owl , reading comics and etc… therefore I was so bored after chit chat with a friend of mine staying in our house , she rent a room but we kinda close thou. I took the huge computer into my room. I was like asking myself how the fuck can I start this computer ? Using the word start cause at that time I am not a IT person yet :) we use boot now pardon me. So it was simple man just slam on the power button like those normal electric appliance. Freaking noisy when the computer startup beep beep and grinding sound all over the machine.  I saw a message " Invalid disk or something like that can’t remember". Beside that giant machine there is a box of floppy disk, 5 inch size floppy. Invalid disk messgae came out from the monochrome display do you know at that time there is no internet? in KL there is no computer books to loan from the library. Ohh well dont even think of public library man. I told myself call it for the night. Went to sleep and next day after school I went to MPH bookstore. I took at look at those computer books on the shelve What the hell pricy tag on those book how can a secondary student afford such books man ????? how ????

Singapore Flyers : Was thinking propose inside a ferris wheel

September 26th, 2007 by kenphang

             

             

               

             

            

June07_01

Propose marriage in that wheel with some light dinner, didn’t know I am so romantic ! But to book the whole capsule is SGD 2k what the hell ???? Imagine a freaking capsule like this —>

June07_02

Yesterday’s raid (Bored to death)

September 26th, 2007 by kenphang

Some of those guys came in late last night therefore we started late around 10pm ended around 12am. As usual we went to kill the second boss in tempest keep (Void Reaver) . Damn I need to respect my warrior talent to protection ,ooh well they gear me up I have to pay them back. We manage to down him in 3 tries. I guess it was autumn festival people still in celebration mood instead of getting real in the game.

interest rate cap

September 26th, 2007 by kenphang

An interest rate cap is a derivative
in which the buyer receives money at the end of each period in which an
interest rate exceeds the agreed strike price.
An example of a cap would be an agreement to receive money for each month the LIBOR rate exceeds 2.5%.

The interest
rate cap can be analyzed as a series of European call
options
or caplets
which exists for each period the cap agreement is in existence.

In formulas a
caplet payoff on a rate L struck
at K is

N\times\alpha\times Max(L-K,0)

where N is the
notional value exchanged and
α is the day count fraction corresponding to the period to which
L applies.

For example
suppose you own the following caplet

· 6 month USD LIBOR rate

· Expiry of 1st February 2007

· Struck at 2.5%

· Notional of 1 million dollars.

Then if the USD
LIBOR rate sets at 3% on 1st February you receive 1m*0.5*max(0.03-0.025,0) =
$2500. Customarily the payment is made at the end of the rate period, in this
case on 1st August.

Basically, this theory behind is a risk product uses the formula will result in protection in rising interest rate. Hmmm does it mean that my current housing loan using Interest Rate Cap/Floor ?

Its friday today !

August 3rd, 2007 by kenphang

Quite a stressful day, my customer ask me why I can’t find out the root cause of the problem. Project life is so stressful in the bank things are so screw up,  they control this control that until the vendor need to speculate those reported incident. Well most of the financial project I have done they are all like that ! Lucky that I have my World of warcraft game to cheer me up every now and then. Last night I was too tired to stay awake for raiding.