Pages

Friday, May 20, 2011

Move towards globalization

(Book Review) - Joseph Stiglitz, Globalization and Its Discontents

World is becoming more and more integrated which have increased the demand of organizations which can function at international level. Export/Import failure in one country can lead to impact on another country so we need somebody like IMF/WTO/World Bank who can come in picture can provide necessary finances to stabilize the country hence the global economy (if that country has no. of stakeholders).

Economy can function either following capitalism model or it can be controlled by Govt. to ensure employment and growth opportunities. None of these paths are bad but both have their own covenants, for economy to function well on itself, it need infrastructure in terms of legal rights,property rights and skill training which is not possible to be build easily. US, best example of market economy has strong laws property rights and well functional schooling system which ensures right skills are available in the economy.

IMF being WEST centralized feels market model to be better in comparison to Govt. model. In its course of action of providing loans poor countries, IMF have always stressed on opening up of economy without ever worrying about the social infrastructure required for that. This approach by IMF have led to sudden move from communism to free market model in Russia which pushed it into a vicious cycle of corruption and unemployment. Similarly its policies of capital liberalzation worsened the east asian crisis where it opened up their economies without caring wheather these countries have organizaions who can sustain competition coming from outside, neither it lead them to devalue their curreny bu pumpiing in the money which furhter lead them down the steps of growth ladder.

Although it wants to implement US model of free trade everywhere but it needs to keep in mind the fact of protectionism followed by US for aluminum and Uranium supplies from Russia to safeguard its domestic suppliers.

I feel the necessity of these institutions but it will be much more fruitful, if policies of loans/grants are defined keeping in social-economic structures of corresponding country in mind. I will day John have done wonderful work by throwing some lights on various projects taken by one of world's most important organization.

Tuesday, May 17, 2011

3 Asset Portfolio Optimization

Till now we have performed our experiment on 2 assets portfolio, let us see how to find out right portfolio when we have more than 2 assets.

Best method is to draw risk/return relation using various combination of weights of portfolios assets. We will need to rewrite our cal_ret and cal_sd function for calculations.

> fmcgtemp &<- read.csv("CNX FMCG01-04-2010-01-04-2011.csv")

> fmcg <- fmcgtemp[[5]]

> fmcgL <- bankl(fmcg,fmcg)

> fmcgM <- mean(fmcgL)

> fmcgSD <- sd(fmcgL)

Function for rate of return

function (first,second,third)

{

a <- rep(1,times=58)

i=0

j=0

k=0

w1=0

count=0

while(w1 <=1){

w2=0

while(w1+w2 <=1){

w3=0

while(w1+w2+w3<1){

w3=1-w1-w2

a[count]= first*w1+ second*w2+third*w3

count=count+1

}

w2=w2+.1

j=j+1

}

w1=w1+.1

i=i+1

}

a

}


Function for standard deviation

function (first,second,third,cora,corb,corc)

{

a <- rep(1,times=58)

i=0

j=0

k=0

w1=0

count=0

while(w1<=1){

w2=0

while(w1+w2<=1){

w3=0

while(w1+w2+w3<1){

w3=1-w1-w2

a[count]= (second*w2)^2+(first*w1)^2+(third*w3)^2+2*w1*w2*first*second*cora+2*w1*w3*first*third*corb+2*w3*w2*second*third*corc

count=count+1

}

w2=w2+.1

j=j+1

}

w1=w1+.1

i=i+1

}

a

}


Calling both the fucntions

>X <- cal_ret(bankM,energyM,fmcgM)

> Y <- cal_sd(bankM,energyM,fmcgM,corBE,corBF,corEF)

>Plot (Y,X)


(Y represents standard deviation and X represent returns made)
This graph clearly shows there will be number of combinations of weights of various assets which will lead to higher returns and less risk.

We again need to find out, investor appetite to reach correct asset allocation.

Sunday, May 15, 2011

Optimizing two asset Portfolio

In this blog we will discuss analysis of two asset portfolio. I will make risk return profile of portfolio from where we can find out the exact weights of assets by using risk appetite of the portfolio.

NIFTY industry indexes is used for our exercise. Data for BANK,ENERGY,FMCG,IT & REALTY indexes has been downloaded from http://www.nseindia.com/content/indices/ind_histvalues.htm, for 1st April 2010 to1st April 2011.

Save all the raw data files into a directory and name according to your convenience (Risk Blog). Next step is to convert required data into vector form and import to R Language. For that purpose we use following commands on terminal


cd /home/sidharth/Risk\ Blog/

R

This will open R interface, Read all the csv data and copy closing price row to bank using following set of commands.

>banktemp<- read.csv("BANK NIFTY01-04-2010-01-04-2011.csv")

>Bank <- banktemp[[2]]

For the calculation of rate of return and standard deviation, we need daily return data. I will find out arithmetic and log normal return by writing following functions.

Function for arthimetic return

bankr ← function(first,second)

{

a= first

a[1]=0

k=length(second)

i=2

while(i<=k) {

a[i]= (second[i]-first[i-1])/first[i-1]

i=i+1

}

a

}


Function for lognormal return

bankl <- function(first,second)

{

a= first

a[1]=0

k=length(second)

i=2

while(i<=k) {

a[i]= log(second[i]/first[i-1])

i=i+1

}

a

}

Call above two functions by passing bank vector as argument, it will return a vector of daily rate of return data . Use following commands

>bankR <- bankr(bank,bank)

>BankL <- bankl(bank,bank)

Plot graph of normal returns using hist(bankR) similarly plot for log normal returns can be ploted using hist(bankL)


Now it is time to calcuate mean return and vairance for the bank index of nifty, this can be done suing following commands

>bankrm <- mean(bankR)

>banklm <- mean(bankL)

Lognormal return is nothing but geometric return and it is better measure of return so we will be using this. Variance is

>bankRsd <- sd(bankR)

>bankLsd <- sd(bankL)

Same set of commands are repeated for energy sector to capture and calculate required figures.

>energytemp<- read.csv("CNX ENERGY01-04-2010-01-04-2011.csv")

>energy<- energytemp[[5]]

Let us calculate correlation, mean and standardization of two assets. Following commands will do this

>corr <- cor(bankL,energyL)

>energyM<- mean(energyL)

>energySD<- sd(energyL)

>bankM <- mean(bankL)

>bankSD<- sd(bankL)

Next step is to use different combination of portfolios weights, and find out corresponding returns and variance of returns.

> w1 <- seq (0,1,by=.05)

>w2<-1-w1

I have defined following two functions to find out return vector and variance vector for all possible combination of weights.

Return function

function (first,second,w1,w2)

{

a= w1

k=length(w1)

i=1

while(i<=k) {

a[i]= second*w2[i]+first*w1[i]

i=i+1

}

a

}

Function to find Standard Deviation

function (first,second,corr,w1,w2)

{

a= w1

k=length(w1)

i=1

while(i<=k) {

a[i]= (second*w2[i])^2+(first*w1[i])^2+2*w1[i]*w2[i]*first*second*corr

i=i+1

}

a

}

Call both the functions using following commands

>X <- cal_ret(bankM,energyM)

>Y <- cal_sd(bankSD,energySD,corr,w1,w2)

Plot (Y,X) will give following graph It shows by changing weights assigned to two assets , one can earn higher amount of returns by having same amount of risk. It is in line with a capital asset pricing market theory. Most left point having return of 4e-04 is most efficient portfolios, all points right above this points are part of efficient frontier.

After finding out risk appetite of investor , we can use this graph to make appropriate allocation to both the assets.


Using Risk free Asset

Let us repeat same exercise by exchanging one asset with risk free asset (Govt. India Securities) and other to be bank index. Following commands do the required calculations and following graphs shows the relation.

>X <- cal_ret(bankM,Rf,w1,w2)

>RfSD <- 0

> Y <- cal_sd(bankSD,RfSD,0,w1,w2)

>plot(Y,X)

Graph start from risk free rate of return and is straight line, which means risk will decrease by sacrificing returns and one can earn extra returns by leveraging on the portfolio.

Risk Management

Globalization have made world more and more integrated. With free execution of trade between countries, prices of commodity not impacted by selected few but almost all major economies, interest rate change in one country impacting through out the world have made risk management more and more important over time and important part of strategy of export houses and businesses who are highly dependable on imports.

I will start my discussion by classifying risk into two categories like known risk and unknown risk. Some people have also introduced terms like lesser known risk. Known are risk which are pretty much known and whose impact can be estimated using sensitivity analysis on portfolios of securities or business products while other form of risk cannot be measured directly. Known risk can be measured hence can be mitigated by following hedging techniques while unknown can't be measured with high confidence hence hedging techniques are also not well defined.

Let us take few examples of various risk in various domains.

IT:

Major risk to IT companies are exchange rate movement, they are highly dependent on value of rupee, other risk they face are attrition,knowledge drain , competition which are business risk which we will not discuss here. Exchange rate of rupee is by product of number of factors like interest rate of countries, foreign exchange flows, current/capital account deficit. Risk manager in IT firm need to account for all these factors while measuring exposure of their business in respect to different countries

Banks:

Banks are in business of exchanging money where they take deposits and give away loan , hence making money on rate difference called as interest margin. Biggest risk they face comes on the amount of loan given to borrowers called as credit risk, if borrower default bank have to pay money from their own pocket. Other big factor is interest rate movement , since major part of bank income comes from interest rate, small change in interest rate can change the whole balance. These two risk need to be accounted in a manager's strategy for banks to stay in the competition. Another form of risk banks face are operational risk, also called risk due to failure of systems/people/natural calamity.

Here in this blog we will talk about risk management for financial companies with focus on

  • Credit Risk

  • Market Risk

  • Operational Risk

Before starting on measurement and mitigation of risk, let us take a look at portfolio management and basic techniques used for portfolio optimization.

Note : Through this blog Indian stock market data will be analyzed and R Language(it is free and works well on my PC) will be used as primary statistical tool.