Thursday 26 February 2015

SOUTH ASIAN ASSOCIATION FOR REGIONAL COOPERATION

SAARC countries share same cultural history since centuries. In the economic terms they were interdependent up to the point but colonial rulers like British, Portugese, Dutch e.t.c shares the colonies and ruled them for their benefits. After the attainment of collective independence, India remained the largest country in all terms ahead of its neighbours. Because India is somewhat peaceful and had a stable political establishment since independence. No two SAARC countries share a boundary and all of them share a boundary with India. India is strong in economic perspective than other SAARC countries so they were not of much help to India.


Pakistan : It never completed the term of 5 years for any government except the recent one. Army, terrorists, internal conflicts e.t.c. hampers the growth of pakistan in every possible way. - Not helpful at all.

Bangladesh : In 1971 India helped it liberate and still the furore continues,  with the opposition trying to establish a islamic state. - Not helpful

Srilanka : LTTE war - relations degraded. But hosting the tamilians who stayed there. - Interests of Indians ( tamils and fishermen) are involved. Have to co-operate with them for greater development of tamil regions.

Maldives, Nepal, Afghanistan : Unstable and micro economies compared to India. India helped them with grants but never the other way around.

Bhutan : Complete dependence on India. 90% of exports to India.

Because of the low economic growth of these countries their help is very less compared to the help given by India. But these nations are handful in terms of population which are potential markets for exports of India. This is the reason MODI is emphasizing of peaceful and good trade relations with neighbours. With SAARC countries led by India and helping out each other for prosperous south asia. It could turn the tables in favour of India in global arena.

An attempt is made to evolve an analytical framework for assessing the health effects in a comparative basis and explore both direct and indirect effects of globalisation on health. The SAARC region is selected as globalisation induced policies particularly in these countries are being questioned on grounds of - rising healthcare cost, WTO compliance costing too high to the domestic industry and economy, and increasing infectious diseases associated with international travel and migration. These issues are further discussed in the light of accessibility, efficiency, and quality of healthcare delivery, geographical inequalities, heavy burden of private healthcare financing, and fiscal stress faced by governments in these countries


The SAARC region was established in December 1985 by Bangladesh, Bhutan, India, Maldives, Nepal, Pakistan and Sri Lanka to promote the welfare of the people of South Asia through accelerated economic growth, social progress and cultural development in South Asia. 

Up till 1970 all SAARC countries struggled with massive poverty, food shortages, heavy disease burden and high illiteracy rates. However, the last two decades have seen significant rise in real income and reduction in poverty levels. The economies of the SAARC region shifted away from being dependent on agriculture to increasing emphasis on modern urban-based industries and service sectors. Initiation of economic reforms during 1990s, particularly in India, Pakistan and Bangladesh has put these economies on the higher growth trajectory path.



It is important to note that despite the sustained average annual growth rate of above 5 per cent over the last two decades, this region continue to suffer from many health problems, and in the global context, lags behind all other regions of the world, both in its income and in human development levels. 

South Asia is by now the poorest region in the world - its per capita income of US$ 309 is much below the US$ 555 of Sub-Saharan Africa and is only one-third of the average of US$ 970 for all developing countries (Human Development Report 2004).

SAARC, tragically, is the world's only region, which has failed to tap the potential for socialcultural exchange and economic cooperation, with the continuation of war and cold war in the region between India and Pakistan. Intra-SAARC trade is dismally as low as 4% and the collective share of the region in world trade was just 1%. Despite spectacular economic growth accompanied by noticeable social change reflected in the spread of basic education and literacy levels, the gains from development have not trickled down to the poor. For instance, in terms of composite human development index (HDI), the rank was as low as 142 nd (out of a list of 177 countries) for Pakistan, 140 th for Nepal, 138 th for Bangladesh, 134 th for Bhutan, 127 th for India with Sri Lanka and Maldives were placed much better at 96th and 84th position, respectively. Although there is an improvement in overall HDI over time, the relative position of SAARC countries has not changed much. The gap between HDI and income rankings was more noticeable for India and Sri Lanka whereas between HDI and life expectancy at birth for Sri Lanka and Maldives. Interestingly, Sri Lanka with relatively lower level of GDP has exceptionally done well in the region by achieving higher levels of longevity and human development

DEMOGRAPHIC PROFILE

The demographic landscape of the SAARC region has seen unprecedented changes over the last 100 years. First half of the 20 th century recorded a slow population growth due to frequent famines and epidemics, such as, plague, cholera and influenza. A high population momentum in SAARC region was noticed during the second half of the 20 th century while experiencing second stage of demographic transition. The population growth rate accelerated and India (which accounts for three-fourths of the region population) doubled its population between 1961 and 1991 and crossed one billion mark in 2001. India, Pakistan and Bangladesh are respectively the second, seventh and ninth most populous countries of the world.

HEALTHCARE SYSTEM AND ROLE OF PUBLIC SECTOR

Over time the healthcare system in SAARC countries has expanded considerably with both public and private sectors playing critical role in delivery of primary and secondary health care. With some exceptions the major health needs of the public are catered for by the public sector. The major boost in infrastructure of the public health care system in SAARC region took place after they endorsed the Alma Ata declaration of 1978 - "health for all by 2000" initiative launched by the World Health Organization.

Due to various socio-economic and political reasons, most SAARC countries (Sri Lanka as an exception) have failed to achieve desired health targets by 2000. Nevertheless under every government the "health for all by 2000" remained an official policy for the state-owned health system, which despite poor resources and mismanagement, provided a big relief to the people of SAARC region.

Entire public health care system in SAARC countries is financed through tax revenues. There is a mixed pattern in government health spending in the region. The share of public spending in India, Pakistan and Nepal is very low (ranging between 18 and 30 % of total health expenditure) whereas for Bangladesh and Sri Lanka, it is about half; and for Bhutan and Maldives as high as 90% . Both in terms of budgetary allocation and as percentage of GDP, the share of public spending has not been stepped up in India and Pakistan. 

Over time, fiscal crunch and mismanagement in the public sector contributed to a worsening of the health service provided. In the meantime a vibrant private healthcare sector flourished in South Asia. No doubt, it is efficient and equals Western standards, but unfortunately, it is run on purely business lines with no ethical values. It is totally unaffordable for the general public and has become one of the most successful businesses in India and Pakistan.


The diffusion of new knowledge and technology and easing of the trade restrictions while enhancing disease surveillance, treatment and prevention, foreign investment in health services and even the medical tourism have exposed the developing world including the SAARC region to serious health risks. Having sustained an average annual growth rate of above 5 per cent over the last two decades, this region still suffers from many serious health problems, and lags behind all other regions of the world while displaying wide range of variations in their health outcomes. It is further brought out in this paper that though the link between globalization and health is very complex and circular, and there is a serious need to evolve a conceptual framework. It would help in (i) identifying the channels and their dynamics through which globalization affects the health sector and (ii) sketching out the broad contours of policy changes in the context of given socio-economic context of this region.

Saturday 6 December 2014

FINANCIAL DATA MODELLING WITH R- PORTFOLIO OPTIMIZATION (PART-II)


PORTFOLIO OPTIMIZATION-2


According to Modern Portfolio Theory, an investor can effectively reduce the total risk of his portfolio through mean-variance optimization (diversification). The analysis in the previous post created portfolios that had negative weights, or "short" positions. To overcome we search for options to block short positions and arrived at a couple of other websites that demonstrated portfolio optimization with more complex models.

Installing the “tseries” package
 
Function portfolio.optim in package “tseries” is called for getting efficient frontier and solve.QP from package “quandprog” is used for portfolio construction.
 
> library("tseries")
> India5 <- read.csv("India5.csv")
> assets <- India5[,3:7]
> returns <- log(tail(assets, -1) / head(assets, -1))
 
Create an optimum portfolio with expected means defined and shorts allowed
 
> w2 <- portfolio.optim(as.matrix(returns),pm = 0.005,shorts = TRUE,riskless= FALSE)
> w2$pw
[1] -0.6421529  2.6189265 -0.3917414 -0.7363362  0.1513039
> sum(w2$pw)
[1] 1
 
Create an optimum portfolio with expected means defined and shorts NOT ALLOWED
 
> w2 <- portfolio.optim(as.matrix(returns),shorts = FALSE,riskless = FALSE)
> w2$pw
[1] 0.07895285 0.24635246 0.05768448 0.60260070 0.01440952
> sum(w2$pw)
[1] 1
> w2$pm
[1] 0.0003442065
 
Create a function to create the frontier using portfolio.optim
 
> frontier2 <- function(return,minRet,maxRet){
+     rbase <- seq(minRet,maxRet,length=100)
+     s <- sapply(rbase,function(x){
+         p2 <- portfolio.optim(as.matrix(returns),pm = x, shorts = TRUE)
+         p2$ps^2
+     })
+     plot(s,rbase,xlab="Variance",ylab="Return", main="w/Portfolio.Optim")
+ }
> frontier2(returns,-0.0005,0.05)
 
It is observed that with Short positions allowed (i.e. shorts=true), the portfolio weights are the same as what was obtained in the previous program ( check PORTFOLIO OPTIMIZATION-1 ), and as expected they sum up to 1.
 
> w2$pw
[1] -0.6421529  2.6189265 -0.3917414 -0.7363362  0.1513039
> sum(w2$pw)
[1] 1
 
But when shorts are not allowed that is shorts= False, we see altogether a different portfolio is created.

> w2$pw
[1] 0.07895285 0.24635246 0.05768448 0.60260070 0.01440952
> sum(w2$pw)
[1] 1
> w2$pm
[1] 0.0003442065
 
However, when short positions are not allowed, it is not possible to specify the portfolio returns beforehand ( as it was, in the shorts allowed case, where pm = 0.005). With this constraint, the portfolio returns has dropped to 0.000344.



The efficient frontier remains the same as before-

FINANCIAL DATA MODELLING WITH R- PORTFOLIO OPTIMIZATION-(PART-I)

PORTFOLIO OPTIMIZATION-1

 
This chapter illustrates how to extract data on returns on 5 Indian Companies that are listed in the NSE and use to create an optimum portfolio and draw the efficient frontier.. The following R program shows how this data for 5 Indian Companies such as Adani Power, Suzlon Energy, NTPC, CESC, GVK has been extracted from Quandl and converted into a CSV file for repeated usage.
Creating Dataset
 
> library(Quandl)
> Quandl.auth ("vFTSoFd2sWdPtJfKz-mn")
> FADANI1314<- Quandl("GOOG/NSE_ADANIPOWER", trim_start="2013-01-01", trim_end="2014-07-30")
> FSUZ1314<- Quandl("NSE/SUZLON", trim_start="2013-01-01", trim_end="2014-07-30")
> FNTPC1314<- Quandl("NSE/NTPC", trim_start="2013-01-01", trim_end="2014-07-30")
> FCESC1314<- Quandl("NSE/CESC", trim_start="2013-01-01", trim_end="2014-07-30")
> FGVK1314<- Quandl("NSE/GVKPIL", trim_start="2013-01-01", trim_end="2014-07-30")
> library("plyr", lib.loc="~/R/win-library/3.1")
> CADANI <- FADANI1314[,c('Date','Close')]
> CCESC <- FCESC1314[,c('Date','Close')]
> CGVK <- FGVK1314[,c('Date','Close')]
> CNTPC <- FNTPC1314[,c('Date','Close')]
> CSUZ <- FSUZ1314[,c('Date','Close')]
> Stocks <- merge(CADANI,CCESC,by.x='Date',by.y='Date')
> Stocks <- rename(Stocks,c("Close.x"="Adani","Close.y"="CESC"))
> Stocks <- merge(Stocks,CGVK,by.x='Date',by.y='Date')
> Stocks <- rename(Stocks,c("Close"="GVK"))
> Stocks <- merge(Stocks,CNTPC,by.x='Date',by.y='Date')
> Stocks <- rename(Stocks,c("Close"="NTPC"))
> Stocks <- merge(Stocks,CSUZ,by.x='Date',by.y='Date')
> Stocks <- rename(Stocks,c("Close"="SUZ"))
> write.csv(Stocks,"India5.csv")
 
 

The main concept of portfolio optimization (which won theNobel Prize for Harry Markowitz in 1990) is based on the correlation between investment products, we can reduce the risk (which in this case is measured by variance) of the portfolio and still get the desired expected return.
> India5 <- read.csv("India5.csv")
> View(India5)
> assets <- India5[,3:7]
> View(assets)
 
Calculate the Returns
 
> returns <- log(tail(assets, -1) / head(assets, -1))
 
To Calculate the Optimum Portfolio Weights
 
 
> OptWeights <- function(return, mu = 0.005) {
+     Q <- rbind(cov(return), rep(1, ncol(assets)), colMeans(return))
+     Q <- cbind(Q, rbind(t(tail(Q, 2)), matrix(0, 2, 2)))
+     b <- c(rep(0, ncol(assets)), 1, mu)
+     head(solve(Q, b),-2)
+ }
 
Call the function with data and note that the weights add up to 1
 
> OptWeights(returns)
     Adani       CESC        GVK       NTPC        SUZ 
-0.6421529  2.6189265 -0.3917414 -0.7363362  0.1513039 
> sum(OptWeights(returns))
[1] 1
 
Defining a function to create the Graph of Efficient Frontier
 
> frontier <- function(return,minRet,maxRet){
+     Q <- cov(return)
+     n <- ncol(assets)
+     r <- colMeans(return)
+     Q1 <- rbind(Q,rep(1,n),r)
+     Q1 <- cbind(Q1,rbind(t(tail(Q1,2)),matrix(0,2,2)))
+     rbase <- seq(minRet,maxRet,length=100)
+     s <- sapply(rbase,function(x){
+         y <- head(solve(Q1,c(rep(0,n),1,x)),n)
+         y %*% Q %*% y
+     })
+     plot(s,rbase,xlab="Variance",ylab="Return", main = "Custom")
+ }
 
Plot the Efficient Frontier between two values of Return
> frontier(returns,-0.0005,0.05)
 

 
On the variance-return plane, the desired return-minimum variance curve is called Portfolio Frontier.
However we note that some of the weights are negative, which means that the portfolio allows "short" positions. It is possible to bar short positions.

Monday 22 September 2014

RDBMS-DW ASSIGNMENT

PART-III

CHAPTER-10

10.1: Adding new columns to the customer dimension



10.2: Adding the order_quantity column



10.3: Revised daily DW regular population





10.4: Adding the order_quantity column to the sales_order table




10.4: Adding the order_quantity column to the sales_order table



10.5: Adding nine sales orders with order quantities




Sales_Order table






CHAPTER-11


11.1: Promotion indicator
11.2: Populating the promotion indicator
11.3: Creating the promotion staging table



CHAPTER-12




12.1: Implementing the month roll-up dimension


12.2: The revised date pre-population script
Query the month_dim to confirm correct population

12.3: PA customers



12.4: Non-PA customers



12.5: The revised daily DW regular population 



12.6: Adding two customers 



CHAPTER-13


13.1: Adding the request_delivery_date_sk column


13.2: The revised daily DW regular population 



13.3: Adding the request_delivery_date column to the sales_order table 





13.4: Adding three sales orders with request delivery dates



13.5: Daily sales summary




13.6: Creating date views 
13.7: Database view role playing




CHAPTER-14


14.1: Creating monthly_sales_order_fact


14.2: Populating month_end_sales_order_fact



14.3: Modifying the sales order table



14.7: Adding two sales orders

14.8: Adding three sales orders with Allocate and/or Packing dates


 14.9: Sales orders with Allocate and/or Packing dates