Russian mutual funds: skill versus luck

Functioning of the Russian financial market and mutual funds. Рarameters that can give information about funds management. Тhe role of skill in Russian equity funds management during the last years. Distribution of number of observations for funds.

Рубрика Финансы, деньги и налоги
Вид дипломная работа
Язык английский
Дата добавления 23.07.2016
Размер файла 724,2 K

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

-0,051639

-0,069948

-33,48%

-68,69%

-0,000037

rajffajzen elektroenergetika

-0,000669

-0,000888

-0,046540

-0,062344

-43,35%

-72,53%

-0,000034

rgs elektroenergetika

-0,000552

-0,000725

-0,043421

-0,056826

-36,43%

-65,24%

0,000053

gorizont aktsii plyus khedzh

-0,000337

-0,000503

-0,060767

-0,082496

-4,68%

NA

0,000156

otkrytie agressivnyj

-0,000500

-0,000621

-0,082728

-0,112121

-15,89%

NA

0,000170

Some funds did not exist 3 years ago and thus have NA in column “3-year”. Full-length returns for these funds are: “sberbank globalnyj internet” - 60,2% 2,5 years, “gorizont aktsii plyus khedzh” - lost 20,4% during 2,5 years, “otkrytie agressivnyj” - lost 21% during 2 years. The last two funds have random returns at 5% significance level for three base models. Also, “gorizont aktsii plyus khedzh” performance is better than the other ones among negative skill funds and it is nominated only by 2209 observations model. So, “gorizont aktsii plyus khedzh” can be ignored. “otkrytie agressivnyj” is still assumed to have negative skills. Among funds with positive skills there is one with negative 3-year returns and low 1-year. The fund is “univer fond aktsij”. But it is among the skilled because it earns 272% during 8,5 years and has high mean returns. This is the reason two models treated the fund as it has positive nonrandom returns. The model with 2209 observations of pseudo residuals claims this fund has random returns. So, the results differs for models, also, recent fund`s performance is below average. Thus “univer fond aktsij” should be ignored.

The two skilled funds that are left are almost even. The bootstrap approach withstood the test - Sharpe and Sortino ratios are the top one (only one fund has higher Sharpe ratio - “tkb bnp pariba perspektivnye investitsii”, which was excluded because of low r-squared), same goes for mean values and real alphas, as for 1- and 3-year returns - the results differ: negative skill are among the worst, positive only one is among the best. The other two have great overall returns. So, the bootstrap approach can provide strong results, which with careful treatment can be trusted.

The final decision is to invest in two funds “sberbank globalnyj internet” and “interfin telekom”. The decision is made at the begging of 2014 year. The investment is oriented on 1-3 years. The results from such investment are measured ex-post. In the table below there are the prices of funds` shares and changes in Russian market - MSCI Russia (with local currency).

Table 17

Ex-post results for positive skill funds.

Instrument

09.01.2014

31.12.2014

Change,%

04.05.2015

Change,%

sberbank globalnyj internet

1593,78 rub.

1752,28 rub.

9,94%

2025,21 rub.

27,07%

interfin telekom

5948,81 rub.

5949,53 rub.

0,01%

6988,16 rub.

17,47%

MSCI Russia

768,79

662,24

-13,86%

817,55

6,34%

The year 2014 was harsh for Russian economy. USA and EU imposed sanctions because of Ukrainian matter. The benchmark dropped by more than 13,8% in national currency, in US dollars the fall was even deeper. But the picked funds has shown positive dynamics and outperform benchmark. If an investor has made a portfolio of these two funds, than in less than 1,5 year he earns 22,27% and in annual form it is 16,28%. This result is higher than mostly any deposit in Russia. There are funds that have higher returns during January 2014 - April 2015, but at least peaked funds are among 1st quarter in terms of returns.

The skilled funds from bootstrap returns were tested ex-post, their results were not the best but at least acceptable. The funds with negative skill should be also tested. The funds with negative picking skills after filtering bootstrap results are: “alfakapital elektroenergetika”, “pallada energetika”, “interfin elektroenergetika”, “rajffajzen elektroenergetika”, “rgs elektroenergetika”. Their returns during January 2014 - April 2015 are presented in the table below.

Table 18

Ex-post results for negative skill funds

Instrument

09.01.2014

31.12.2014

Change,%

04.05.2015

Change,%

Liquidation

MSCI Russia

768,79

662,24

-13,86%

817,55

6,34%

-

alfakapital elektroenergetika

284,3 rub

313,88 rub

10,40%

340,39 rub

19,73%

-

pallada energetika

1 332,69 rub

1 299,53 rub

-2,49%

-

-

11.11.2014

interfin elektroenergetika

331,78 rub

262,15 rub

-20,99%

351,09 rub

5,82%

-

rajffajzen elektroenergetika

2 680,47 rub

2 316,28 rub

-13,59%

2 807,36 rub

4,73%

-

rgs elektroenergetika

324,93 rub

238,18 rub

-26,70%

305,85 rub

-5,87%

-

otkrytie agressivnyj

789,96 rub

737,49 rub

-6,64%

-

-

16.10.2014

According to the table 2 out of 6 funds have been liquidated during the period. Three more funds have negative one-year performance and underperform the market in 1 year and 4 months period. But one of the funds assumed to have negative skills outperform the benchmark and even one of the positive skill funds. “Alfakapital elektroenergetika” provides 19,73% for the period January 2014 - April 2015, which is 14,46% per annum. The reason can be this: the fund was at its minimum value (even below the bottom of 2008 crisis, when minimum value was 329,6 rubles) on the first days of testing period and this growth is a correction. But it does not change the fact that this investment provide good returns. Thus bootstrap approach can be used alongside other instruments in decision making process. With careful adjustment this approach can provide valuable information and show acceptable results.

Conclusion

Investors all over the world are looking for promising assets. Some of them want to earn high returns, others - to save and diversify their wealth. Mutual funds are one of the instruments of financial market that are managed by professionals. It is a good choice for investments for both: people that are not professional participants of financial market and are willing to give their money in hands of professionals to be managed skillfully, and also as promising assets for market participants and even companies and other funds. But as well as other type of assets there are funds that can show good performance and also funds that provide losses. There is asymmetry of information on the market of mutual funds: investors do not have full information of managers` skills, but managers are aware of their possibilities. In order to get more information about funds` abilities investors, analysts and economists are looking for methods to measure the performance of a fund and its managers` skills. Bootstrap approach and similar to it methods are built up to deal with this information asymmetry.

But before bootstrap the coefficient that is supposed to measure managers` picking skills is Jensen alpha. It represents the value of how much more or less returns the manager systematically provides in terms of a certain model. But what if the period that was used in the model was just a lucky time for that manager? What if the returns are due to luck and not skill? The alpha describes both luck and skill. And the investors probably do not want to invest in a lucky fund without goo skill as the fortune will not always be on the funds side. Thus there is a need to distinguish skill from luck. This goal can be achieved with approaches that simulate random portfolios with similar characteristics for a fund. These portfolios represents luck and their alpha distribution is nothing else but distribution of luck. One of approaches that can do this is bootstrap approach. It was already used by several economists for different markets all over the world including Russia.

The approach used in this research is similar to those in other papers about bootstrap approach. Aside from unique sample (time period, funds in the sample) and special models (no bootstrap approach in other papers is based on the models in this research) this paper also uncovers settings in bootstrap approach that strongly influence the result. These settings and assumptions are based on economic point of view and not only one set up can be used to investigate the question of skill presence for funds` managers. Moreover, in this paper to get final results is used a combination of set ups for bootstrap approach filtered with other famous statistics that measure fund`s performance. Since the research question is to develop and apply the method that can measure funds managers` skills, the resulted method involves not only bootstrap approach but also other statistics to support bootstrap`s results.

The result of combined method is acceptable, the funds that are assumed with skill have the direction of their returns vector in ex-post period predicted by the approach. According to this research method the market of mutual funds in Russia is inefficient, most funds have no evidence of skill, among the funds with skilled managers negative nonrandom returns prevail. Bootstrap approach provides evidence of negative picking skill for 6 funds and positive for only 2 funds out of 175. For these funds zero hypothesis about random returns is rejected, for all the others - accepted. The distribution of simulated alphas in comparison with real alphas suggests that most equity funds do not have sufficient skill to provide benchmark adjusted returns to cover the costs of management. Thus the zero hypothesis for the market is accepted. It claims random returns for the funds in general, only 4,6% of funds have nonrandom returns.

Further investigation is needed as the research has limitations. The main one is connected with models` specifications. One of possible enhancement of this approach is to create a well-suited model that can satisfy all funds` requirements. Equity funds invest have different investment strategies: aside from Russian blue chips, they invest in industries on Russian market, companies of low capitalization (others in high), commodities (including in foreign currencies), global market and in funds (Russian and foreign). For proper analysis the model`s specification for the whole market (one for all funds) should include many factors like industry indexes. But those alone will be not enough, factors like SMB, HML estimated for Russian market may also be of good use, as well as commodity indexes, currencies, global market indexes and etc. The models used in this research does not reflect each fund`s specification. The best model with Brent oil and USD/RUB can follow foreign assets and “Oil and gas” industry a bit (still very low r-squared and not enough explanatory factors), but it cannot describe some funds at all. Thus the results of this research are sufficient for some funds and inappropriate for others as r-squared is low for many funds. So, the result for whole market may be insignificant. But for single funds (if a model has r-squared sufficient enough) the bootstrap approach with cautious adjustment can provide stable results that are significant. The method provided by this research can still provide useful information about funds. Even with models that have low r-squared one can filter the results and make appropriate conclusions.

This paper and its methods can be useful for investors in their decision making process, as the approach can help to pick a skilled fund. What is more, it can provide useful information for possible stakeholders. This research`s methods can also help managers to test and track their skills or may be even make a decision to change their management policy.

References

Articles:

1. Ayadi M., Kryzanowski L. 2011. Fixed-income Fund Performance: Role of Luck and Ability in Tail Membership // Journal of Empirical Finance, 2011. - Vol. 18(3). - p. 379 -392.

2. Carhart M. 1997. On persistence in mutual fund performance // The Journal of Finance, 1997. - Vol. 52. - p. 57-82.

3. Cuthbertson K., Nitzsche D., O'Sullivan N. 2008. UK Mutual Fund Performance: Skill or Luck? // Journal of Empirical Finance, 2008. - Vol. 15. - p. 613-634.

4. Doncel L.M., Grau P., Otamendi J., Sainz J. 2011 The Truth About Mutual Funds Across Europe // Applied Economics Letters, 2011. - Vol. 18(7). - p. 687-692.

5. Fama E. 1970. Efficient Capital Markets: a Review of Theory and Empirical Work // The Journal of Finance, - Vol. 25(2). - p. 383-417.

6. Fama E. 1972. Components of investment performance // The Journal of Finance, 1972. - Vol. 27. No. 2. - p. 551-567.

7. Fama E., French K. 1992. The Cross-Section of Expected Stock Returns // The Journal of Finance, 1992. - Vol. 47. No. 2. - p. 427-465.

8. Fama E., French K. 2010. Luck versus skill in the cross-section of mutual fund returns // The Journal of Finance, 2010. - Vol. 65. - p. 1915-1945.

9. Graham J., Harvey C. 1996. Market timing ability and volatility implied in investment newsletters` asset allocation recommendations // Journal of Financial Economics, 1996. - Vol. 42. - p. 397-421.

10. Grinblatt M., Titman S. 1989. Portfolio performance evaluation: old issues and new insights // Review of Financial Studies, 1989. - Vol. 2. - p. 393-421.

11. Grinblatt M., Titman S. 1992. The persistence of mutual fund performance // The Journal of Finance, 1992. - Vol. 47. No. 5. - p. 1977-1984.

12. Jensen M. 1967. Random walks: Reality or myth--comment // Financial Analysts Journal, 1967. - Vol. 23. - p. 77-85.

13. Jensen M. 1968. The performance of mutual funds in the period 1945-1964 // Journal of Finance, 1968. - Vol. 23. No. 2. - p. 389-416.

14. Jensen M. 1969. Risk, the pricing of capital assets, and the evaluation of investment performance // Journal of Business, 1969. - Vol. 42. - p. 167-247.

15. Jarque C., Bera A. 1987. A test for normality of observations and regression residuals // International Statistical Review, 1987. - Vol. 55. - p. 163-172.

16. Kosowski R, Timmermann A, Wermers R, White H. 2006. Can mutual fund “stars” really pick stocks? New evidence from a bootstrap analysis // The Journal of Finance, 2006. - Vol.61. - p. 2551-2295.

17. Layfield L., Stevenson S. 2011. Separating skill from luck in REIT mutual funds // Working Papers in Real Estate & Planning, 2011. University of Reading. - p. 33.

18. Lo А. 2007. Efficient Market Hypothesis // The New Palgrave Dictionary of Economics. 2nd Edition. Eds. S. Durlauf, E. Blume. Palgrave Macmillan Ltd., - 2007.

19. Samuelson P. 1965. Proof That Properly Anticipated Prices Fluctuate Randomly // Industrial Management Review, 1965. - Vol. 6. - p. 41-9.

20. Sharpe W. 1966. Mutual Fund Performance // Journal of Business, 1966. - Vol. 39. - p. 119-138.

21. Sharpe, W. 1994. The Sharpe Ratio // The Journal of Portfolio Management, 1994. - Vol. 21. - p. 49 - 58.

22. Sortino F., Meer R. 1991. Downside Risk // The Journal of Portfolio Management, 1991. - Vol. 17. Isuue. 4. - p. 27-31.

23. Sortino F., Meer R., Plantinga A. (1999) The Dutch Triangle // The Journal of portfolio management, 1999. - Issue 99. - p. 22.

24. Suh S., Hong K. 2011. Control of Luck in Measuring Investment Fund Performance // Asia-pacific Journal of Financial Studies, 2011. - Vol. 40. - p. 467- 493.

25. Treynor J. 1965. How to Rate Management of Investment Funds // Harvard Business Review, 1965. - Vol. 43. - p. 63-75.

26. Treynor J., Black F. 1973. How to Use Security Analysis to Improve Portfolio Selection // Journal of Business, 1973. - Vol. 46. - p. 66-86.

27. Wermers, R. 2000. Mutual Fund Performance: An Empirical Decomposition into Stock Picking Talent, Style, Transactions Costs, and Expenses // The Journal of Finance, 2000. - Vol. 55. - p. 1655-1703.

Monographs:

1. Muravyev D.M. 2006. Do Russian Mutual Funds Overperform the Market? // Working Paper # BSP/2006/085 E. - Moscow, New Economic School, 2006. - 26 p. (Engl.)

2. Parshakov P.A. 2015. Estimation of skill of Russian mutual fund managers // Applied Econometrics, Publishing House "SINERGIA PRESS", 2015. - Vol. 37(1). - p. 57-66.

Internet resources:

1. Consultant plus. Informational portal, available at: http://www.consultant.ru

2. Investfunds (2015), Cbonds group. Informational portal with funds` database, available at: http://www.investfunds.ru

3. Morgan Stanley Capital International. Indexes, available at: https://www.msci.com/end-of-day-data-search

4. National league of managers (2015). Informational portal with funds` database, available at: http://www.nlu.ru

5. Raexpert (2014), international group of rating agencies, available at: http://www.raexpert.ru/researches/ua/obzor_pif2013_11/obzor_pif_2013.pdf

6. R-forge. R informational portal, available at: http://r-forge.r-project.org

Appendix

Script in R

#Preparing initial data

bench=bencmarks[2:2341,2]

equity1=mf[,-seq(1,NCOL(mf),3)]

equity2=equity1[,seq(1,NCOL(equity1),2)]

equity=equity2[1:2223,]

BrentRub<-Brent[,2]*UsdRub[,2]

BrentRub<-as.numeric(BrentRub)

Fund_names=colnames(equity)

#From prices to returns

equity_returns = (head(equity, -1) - tail(equity, -1)) / tail(equity, -1)

bench_returns = (head(bench, -1) - tail(bench, -1)) / tail(bench, -1)

Brent_returns = (head(Brent[,2], -1) - tail(Brent[,2], -1)) / tail(Brent[,2], -1)

UsdRub_returns = (head(UsdRub[,2], -1) - tail(UsdRub[,2], -1)) / tail(UsdRub[,2], -1)

Rf_returns<-(as.numeric(Risk_free_rate[,2])/100+1)^(1/247)-1

BrentRub_returns = (head(BrentRub, -1) - tail(BrentRub, -1)) / tail(BrentRub, -1)

summary(bench_returns)

sd(bench_returns)

n_obs = apply(equity_returns,2, function (x) NROW( x[!is.na(x)] ))

#First, adjust date in time series

b<-bencmarks[-c(1,43,146,169,170,174:176,214,257:262,303,407,431,432,475,485,518:523,564,668,693,698,737,746,778:783, 824,825,928,953,958,998,1007,1008,1039:1044,1086, 1189,1213,1219,1258,1268,1299:1305,1347, 1348,1449,1450,1474,1479,1480,1518,1528,1562:1568,1608,1617,1646,1712,1713,1736,1739,1741,1742, 1743,1776,1780,1782,1789,1813,1823:1828,1868,1874,1956,1973,1997,1998,2003,2041,2049,2050, 2083:2088,2129,2194,2233,2235,2257,2258,2264,2274,2296,2301,2310,2342:2623),]

equityfunds<-mf[-c(780,960,1242,1284,1388,1413,1493,1634,1660,1899,1948,2142,2224:2995),]

equityfunds[2211,1]

b[2211,]

Funds_adj<-equityfunds[-c(248),]

Benchmark_adj<-b[-c(248),]

#Now we can estimate returns

Funds1=Funds_adj[,-seq(1,NCOL(Funds_adj),3)]

Funds_adj_col=Funds1[,seq(1,NCOL(Funds1),2)]

Benchmark_adj_col=Benchmark_adj[,2]

##deleting funds operating less than an year

Funds_returns = (head(Funds_adj_col, -1) - tail(Funds_adj_col, -1)) / tail(Funds_adj_col, -1)

Funds_returns_adj=Funds_returns[,-c(76,77,79,84,88,92,103,115,177,178,180,181,182,189,191,192,193,196,200,201,202,204,213,214,215,217,218)]

Funds_returns_adj$oplot_metallurgiya<-NULL

Funds_returns_adj$denezhkin_kamen<-NULL

Funds_returns_adj$oplot___alternativnaya_energetika<-NULL

Funds_returns_adj$shag_pervyj<-NULL

Funds_returns_adj$rgs_perspektivnye_investitsii<-NULL

Funds_returns_adj$alfa_kapital_perspektiva<-NULL

Funds_returns_adj$oplot<-NULL

Funds_returns_adj$kanopus<-NULL

Funds_returns_adj$rskhb_fond_aktsij<-NULL

Funds_returns_adj$vysokie_tekhnologii<-NULL

Funds_returns_adj$almaz<-NULL

Funds_returns_adj$pallada_fond_aktsij_vtorogo_eshelon<-NULL

Funds_returns_adj$arsagera_a_6.4<-NULL

Funds_returns_adj$adekta_fond_aktsij_vtorogo_eshelona<-NULL

Funds_returns_adj$everest_aktsii<-NULL

Funds_returns_adj$energokapital_mirovye_rynki<-NULL

Funds_returns_adj$investitsionnyj_respublikanskij_fon<-NULL

benchmark_returns = (head(Benchmark_adj_col, -1) - tail(Benchmark_adj_col, -1)) / tail(Benchmark_adj_col, -1)

Micex_returns = (head(MICEX[,2], -1) - tail(MICEX[,2], -1)) / tail(MICEX[,2], -1)

####Brent, UsdRub, risk-free rate were already adjusted in excel

#Creating series with statistics

n_observations = apply(Funds_returns_adj,2, function (x) NROW( x[!is.na(x)] ))

Mean_returns<-data.frame(MEAN=numeric(175))

for (i in 1:175){

Mean_returns[i,]<-mean(Funds_returns_adj[,i],na.rm=TRUE)

}

Median_returns<-data.frame(MEDIAN=numeric(175))

for (i in 1:175){

Median_returns[i,]<-median(Funds_returns_adj[,i],na.rm=TRUE)

}

StDev_returns<-data.frame(StDev=numeric(175))

for (i in 1:175){

StDev_returns[i,]<-sd(Funds_returns_adj[,i],na.rm=TRUE)

}

Min_returns<-data.frame(Min=numeric(175))

for (i in 1:175){

Min_returns[i,]<-min(Funds_returns_adj[,i],na.rm=TRUE)

}

Max_returns<-data.frame(Max=numeric(175))

for (i in 1:175){

Max_returns[i,]<-max(Funds_returns_adj[,i],na.rm=TRUE)

}

#Distribution of statistics

plot(density(n_obs), type = "l", col = "black", main = "Distribution of n_obs", xlab = "observations", ylab = "density")

plot(density(n_observations), type = "l", col = "black", main = "Distribution of n_obs", xlab = "observations", ylab = "density")

plot(density(Mean_returns[,1]), type = "l", col = "black", main = "Distribution of mean", xlab = "Mean", ylab = "density")

abline(v =0, col="black")

abline(v=mean(benchmark_returns),col="red")

plot(density(Median_returns[,1]), type = "l", col = "black", main = "Distribution of median", xlab = "Median", ylab = "density")

abline(v =0, col="black")

abline(v=median(benchmark_returns),col="red")

plot(density(Max_returns[,1]), type = "l", col = "black", main = "Distribution of max", xlab = "Max", ylab = "density")

abline(v=max(benchmark_returns),col="red")

plot(density(Min_returns[,1]), type = "l", col = "black", main = "Distribution of min", xlab = "Min", ylab = "density")

abline(v=min(benchmark_returns),col="red")

plot(density(StDev_returns[,1]), type = "l", col = "black", main = "Distribution of standart deviation", xlab = "Standart Deviation", ylab = "density")

abline(v =0, col="black")

abline(v=sd(benchmark_returns),col="red")

#### Discriptive statistics for all funds

FR<-as.numeric(as.matrix(Funds_returns_adj))

summary(FR, na.rm=TRUE)[1:6]

sd(FR, na.rm=TRUE)

plot(density(na.omit(FR)), type = "l", xlim=c(-0.06,0.06), col = "black", main = "Distribution of returns", xlab = "observations", ylab = "density")

abline(v =0, col="red")

Stat_funds <- do.call(data.frame,

list(mean = apply(Funds_returns_adj, 2, mean, na.rm=TRUE),

min = apply(Funds_returns_adj, 2, min, na.rm=TRUE),

median = apply(Funds_returns_adj, 2, median, na.rm=TRUE),

max = apply(Funds_returns_adj, 2, max, na.rm=TRUE),

sd = apply(Funds_returns_adj, 2, sd, na.rm=TRUE),

n = apply(Funds_returns_adj, 2, function (x) NROW( x[!is.na(x)] ))))

####Normality test - Jarque Bera

JarqueBera<-data.frame(JarqueBera=numeric(175))

for (i in 1:175) {

JarqueBera[i,]<-jbTest(na.omit(Funds_returns_adj[,i]))@test$p.value[3]

}

#alphas estimations

##Cov and var for B

Covar<-data.frame(Covariance=numeric(175))

for (i in 1:175) {

Covar[i,]=cov(Funds_returns_adj[,i],benchmark_returns,use="complete.obs")

}

Var_benchmark<-var(benchmark_returns)

sd(benchmark_returns)^2

##Having rf,rm,r,var,cov we can estimate Jensen alphas

###Trying lm and equation to see the difference in alphas (without Brent oil in rubles)

alpha<-mean(Funds_returns_adj[,1],na.rm=TRUE)-mean(Rf_returns)-(cov(Funds_returns_adj[,1],benchmark_returns,use="complete.obs")/Var_benchmark)*(mean(benchmark_returns)-mean(Rf_returns))

RiskMarketPremium<-benchmark_returns-Rf_returns[1:2209]

RiskMarketPremium_Micex<-Micex_returns-Rf_returns[1:2209]

Regression<-lm(Funds_returns_adj[,1]-Rf_returns[1:2209]~RiskMarketPremium)

Beta<-cov(Funds_returns_adj[,1],benchmark_returns,use="complete.obs")/Var_benchmark

alpha

Beta

Regression

####The results are the same for this particular case, but for funds with NA they will differ, we should use regression

########################################

#Now we can get distribution of alphas

ReturnsaboveRf<-Funds_returns_adj-Rf_returns[1:2209]

## For Brent+UsdRub

Regression_Alpha_Brent_Rub<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Regression_Alpha_Brent_Rub[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns))$coefficients[1,1]

}

summary(Regression_Alpha_Brent_Rub)

sd(Regression_Alpha_Brent_Rub[,1])

## For BrentRub

Regression_Alpha_BrentRub<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Regression_Alpha_BrentRub[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+BrentRub_returns))$coefficients[1,1]

}

summary(Regression_Alpha_BrentRub)

sd(Regression_Alpha_BrentRub[,1])

##For CAPM

Regression_Alpha_CAPM<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Regression_Alpha_CAPM[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium))$coefficients[1,1]

}

summary(Regression_Alpha_CAPM)

sd(Regression_Alpha_CAPM[,1])

#R-squared

R_squared_Brent_Rub<-data.frame(R_squared=numeric(175))

for (i in 1:175) {

R_squared_Brent_Rub[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns))$r.squared

}

summary(R_squared_Brent_Rub)

sd(R_squared_Brent_Rub[,1])

R_squared_BrentRub<-data.frame(R_squared=numeric(175))

for (i in 1:175) {

R_squared_BrentRub[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+BrentRub_returns))$r.squared

}

summary(R_squared_BrentRub)

sd(R_squared_BrentRub[,1])

R_squared_CAPM<-data.frame(R_squared=numeric(175))

for (i in 1:175) {

R_squared_CAPM[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium))$r.squared

}

summary(R_squared_CAPM)

sd(R_squared_CAPM[,1])

R_squared<-matrix(nrow=175,ncol=3)

colnames(R_squared)<-c('CAPM','BrentRub','Brent+Rub')

R_squared[,1]<-R_squared_CAPM[,1]

R_squared[,2]<-R_squared_BrentRub[,1]

R_squared[,3]<-R_squared_Brent_Rub[,1]

plot(density(R_squared[,1]), lty=3, col = "blue", main = "R_squared", xlab = "R_squared", ylab = "density")

lines(density(R_squared[,2]), lty=2, col = "red", main = "R_squared", xlab = "R_squared", ylab = "density")

lines(density(R_squared[,3]), type = "l", col = "black", main = "R_squared", xlab = "R_squared", ylab = "density")

mean(R_squared)

####Testing R-squared for Micex

Regression_Alpha_Brent_Rub_Micex<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Regression_Alpha_Brent_Rub_Micex[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium_Micex+Brent_returns+UsdRub_returns))$coefficients[1,1]

}

R_squared_Brent_Rub_Micex<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

R_squared_Brent_Rub_Micex[i,]<-summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium_Micex+Brent_returns+UsdRub_returns))$r.squared

}

summary(R_squared_Brent_Rub_Micex)

sd(R_squared_Brent_Rub_Micex[,1])

########################################

#Graph for Real Alpha

plot(density(Regression_Alpha_Brent_Rub[,]), type = "l", col = "black", main = "Real Alpha(Brent+Rub)", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

plot(density(Regression_Alpha_BrentRub[,]), type = "l", col = "black", main = "Real Alpha(BrentRub)", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

plot(density(Regression_Alpha_CAPM[,]), type = "l", col = "black", main = "Real Alpha(CAPM)", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

#all on one pic

plot(density(Regression_Alpha_Brent_Rub[,]), type = "l", ylim=c(0,1400), col = "black", main = "Real Alpha", xlab = "Alpha", ylab = "density")

lines(density(Regression_Alpha_BrentRub[,]), lty=2, col = "red", main = "Real Alpha(BrentRub)", xlab = "Alpha", ylab = "density")

lines(density(Regression_Alpha_CAPM[,]), lty=3, col = "blue", main = "Real Alpha(CAPM)", xlab = "Alpha", ylab = "density")

abline(v =0, col="green")

###Yearly

Regression_Alpha_perannum_Brent_Rub<-data.frame(Alpha=numeric(175))

Regression_Alpha_perannum_Brent_Rub<-(Regression_Alpha_Brent_Rub+1)^247-1

plot(density(Regression_Alpha_perannum_Brent_Rub), type = "l", col = "black", main = "Real Year Alpha(Brent+Rub)", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

Regression_Alpha_perannum_BrentRub<-data.frame(Alpha=numeric(175))

Regression_Alpha_perannum_BrentRub<-(Regression_Alpha_BrentRub+1)^247-1

plot(density(Regression_Alpha_perannum_BrentRub), type = "l", col = "black", main = "Real Year Alpha(BrentRub)", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

Regression_Alpha_perannum_CAPM<-data.frame(Alpha=numeric(175))

Regression_Alpha_perannum_CAPM<-(Regression_Alpha_CAPM+1)^247-1

plot(density(Regression_Alpha_perannum_CAPM), type = "l", col = "black", main = "Real Year Alpha(CAPM)", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

#all in one

plot(density(Regression_Alpha_perannum_Brent_Rub), type = "l", ylim = c(0,5.5), col = "black", main = "Real Year Alpha", xlab = "Alpha", ylab = "density")

abline(v =0, col="red")

lines(density(Regression_Alpha_perannum_BrentRub), lty = 2, col = "green")

lines(density(Regression_Alpha_perannum_CAPM), lty = 3, col = "blue")

legend (0.4,5,c("Brent and Rub","Brent in Rub","CAPM"),lty=c(1,2,3), col=c("black","green","blue"))

######################################

#Best and worst Alphas

BrentandRubAlpha<-data.frame(Alpha=numeric(175))

rownames(BrentandRubAlpha)<-colnames(Funds_returns_adj)

BrentandRubAlpha[,1]<-Regression_Alpha_Brent_Rub[,1]

Brent_Rub_sort_alphas<-BrentandRubAlpha[order(BrentandRubAlpha[,1]),, drop=FALSE]

Brent_Rub_top_alphas<-Brent_Rub_sort_alphas[171:175,,drop=FALSE]

Brent_Rub_worst_alphas<-Brent_Rub_sort_alphas[1:5,,drop=FALSE]

BrentinRubAlpha<-data.frame(Alpha=numeric(175))

rownames(BrentinRubAlpha)<-colnames(Funds_returns_adj)

BrentinRubAlpha[,1]<-Regression_Alpha_BrentRub[,1]

BrentRub_sort_alphas<-BrentinRubAlpha[order(BrentinRubAlpha[,1]),, drop=FALSE]

BrentRub_top_alphas<-BrentRub_sort_alphas[171:175,,drop=FALSE]

BrentRub_worst_alphas<-BrentRub_sort_alphas[1:5,,drop=FALSE]

CAPMAlpha<-data.frame(Alpha=numeric(175))

rownames(CAPMAlpha)<-colnames(Funds_returns_adj)

CAPMAlpha[,1]<-Regression_Alpha_CAPM[,1]

CAPM_sort_alphas<-CAPMAlpha[order(CAPMAlpha[,1]),, drop=FALSE]

CAPM_top_alphas<-CAPM_sort_alphas[171:175,,drop=FALSE]

CAPM_worst_alphas<-CAPM_sort_alphas[1:5,,drop=FALSE]

###################################

###Regressions with 500 observations

Short_Alpha_Brent_Rub<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Short_Alpha_Brent_Rub[i,]<-summary(lm(ReturnsaboveRf[1:500,i]~RiskMarketPremium[1:500]+Brent_returns[1:500]+UsdRub_returns[1:500]))$coefficients[1,1]

}

summary(Short_Alpha_Brent_Rub)

sd(Short_Alpha_Brent_Rub[,1])

Short_Alpha_BrentRub<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Short_Alpha_BrentRub[i,]<-summary(lm(ReturnsaboveRf[1:500,i]~RiskMarketPremium[1:500]+Brent_returns[1:500]))$coefficients[1,1]

}

summary(Short_Alpha_BrentRub)

sd(Short_Alpha_BrentRub[,1])

Short_Alpha_CAPM<-data.frame(Alpha=numeric(175))

for (i in 1:175) {

Short_Alpha_CAPM[i,]<-summary(lm(ReturnsaboveRf[1:500,i]~RiskMarketPremium[1:500]))$coefficients[1,1]

}

summary(Short_Alpha_CAPM)

sd(Short_Alpha_CAPM[,1])

###

Short_BrentandRubAlpha<-data.frame(Alpha=numeric(175))

rownames(Short_BrentandRubAlpha)<-colnames(Funds_returns_adj)

Short_BrentandRubAlpha[,1]<-Short_Alpha_Brent_Rub[,1]

Short_Brent_Rub_sort_alphas<-Short_BrentandRubAlpha[order(Short_BrentandRubAlpha[,1]),, drop=FALSE]

Short_Brent_Rub_top_alphas<-Short_Brent_Rub_sort_alphas[171:175,,drop=FALSE]

Short_Brent_Rub_worst_alphas<-Short_Brent_Rub_sort_alphas[1:5,,drop=FALSE]

Short_BrentinRubAlpha<-data.frame(Alpha=numeric(175))

rownames(Short_BrentinRubAlpha)<-colnames(Funds_returns_adj)

Short_BrentinRubAlpha[,1]<-Short_Alpha_BrentRub[,1]

Short_BrentRub_sort_alphas<-Short_BrentinRubAlpha[order(Short_BrentinRubAlpha[,1]),, drop=FALSE]

Short_BrentRub_top_alphas<-Short_BrentRub_sort_alphas[171:175,,drop=FALSE]

Short_BrentRub_worst_alphas<-Short_BrentRub_sort_alphas[1:5,,drop=FALSE]

Short_CAPMAlpha<-data.frame(Alpha=numeric(175))

rownames(Short_CAPMAlpha)<-colnames(Funds_returns_adj)

Short_CAPMAlpha[,1]<-Short_Alpha_CAPM[,1]

Short_CAPM_sort_alphas<-Short_CAPMAlpha[order(Short_CAPMAlpha[,1]),, drop=FALSE]

Short_CAPM_top_alphas<-Short_CAPM_sort_alphas[171:175,,drop=FALSE]

Short_CAPM_worst_alphas<-Short_CAPM_sort_alphas[1:5,,drop=FALSE]

#####################Bootstrap#####################

#Store Beta

Beta1_Brent_Rub<-data.frame(Beta1=numeric(175))

for (i in 1:175) {

Beta1_Brent_Rub[i,]=summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns))$coefficients[2,1]

}

Beta2_Brent_Rub<-data.frame(Beta2=numeric(175))

for (i in 1:175) {

Beta2_Brent_Rub[i,]=summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns))$coefficients[3,1]

}

Beta3_Brent_Rub<-data.frame(Beta3=numeric(175))

for (i in 1:175) {

Beta3_Brent_Rub[i,]=summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns))$coefficients[4,1]

}

Beta1_BrentRub<-data.frame(Beta1=numeric(175))

for (i in 1:175) {

Beta1_BrentRub[i,]=summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+BrentRub_returns))$coefficients[2,1]

}

Beta2_BrentRub<-data.frame(Beta2=numeric(175))

for (i in 1:175) {

Beta2_BrentRub[i,]=summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium+BrentRub_returns))$coefficients[3,1]

}

Beta1_CAPM<-data.frame(Beta1=numeric(175))

for (i in 1:175) {

Beta1_CAPM[i,]=summary(lm(ReturnsaboveRf[,i]~RiskMarketPremium))$coefficients[2,1]

}

#Store residuals

Residuals_Brent_Rub<-matrix(nrow=2209,ncol=175)

colnames(Residuals_Brent_Rub)=colnames(Funds_returns_adj)

for (i in 1:175) {

fit1<-lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns, na.action=na.exclude)

Residuals_Brent_Rub[,i]<-resid(fit1)

}

#Tests

JarqueBera_residuals_Brent_Rub<-data.frame(JarqueBera=numeric(175))

for (i in 1:175) {

JarqueBera_residuals_Brent_Rub[i,]<-jbTest(na.omit(Residuals_Brent_Rub[,i]))@test$p.value[3]

}

DurbinWatson_residuals_Brent_Rub<-data.frame(DurbinWatson=numeric(175))

for (i in 1:175) {

DurbinWatson_residuals_Brent_Rub[i,]<-dwtest(lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns+UsdRub_returns), alt='two.sided')$p.value

}

autocor_Brent_Rub<-data.frame(Autocorrelation=numeric(175))

for (i in 1:175) {

autocor_Brent_Rub[i,]<- if (DurbinWatson_residuals_Brent_Rub[i,]<0.05) {1} else {0}

}

sum(autocor_Brent_Rub)

###

Residuals_BrentRub<-matrix(nrow=2209,ncol=175)

colnames(Residuals_BrentRub)=colnames(Funds_returns_adj)

for (i in 1:175) {

fit2<-lm(ReturnsaboveRf[,i]~RiskMarketPremium+Brent_returns, na.action=na.exclude)

Residuals_BrentRub[,i]<-resid(fit2)

}

#Tests

JarqueBera_residuals_BrentRub<-data.frame(JarqueBera=numeric(175))

for (i in 1:175) {

JarqueBera_residuals_BrentRub[i,]<-jbTest(na.omit(Residuals_BrentRub[,i]))@test$p.value[3]

}

DurbinWatson_residuals_BrentRub<-data.frame(DurbinWatson=numeric(175))

for (i in 1:175) {

DurbinWatson_residuals_BrentRub[i,]<-dwtest(lm(ReturnsaboveRf[,i]~RiskMarketPremium+BrentRub_returns), alt='two.sided')$p.value

}

autocor_BrentRub<-data.frame(Autocorrelation=numeric(175))

for (i in 1:175) {

autocor_BrentRub[i,]<- if (DurbinWatson_residuals_BrentRub[i,]<0.05) {1} else {0}

}

sum(autocor_BrentRub)

###

Residuals_CAPM<-matrix(nrow=2209,ncol=175)

colnames(Residuals_CAPM)=colnames(Funds_returns_adj)

for (i in 1:175) {

fit3<-lm(ReturnsaboveRf[,i]~RiskMarketPremium, na.action=na.exclude)

Residuals_CAPM[,i]<-resid(fit3)

}

#Tests

JarqueBera_residuals_CAPM<-data.frame(JarqueBera=numeric(175))

for (i in 1:175) {

JarqueBera_residuals_CAPM[i,]<-jbTest(na.omit(Residuals_CAPM[,i]))@test$p.value[3]

}

DurbinWatson_residuals_CAPM<-data.frame(DurbinWatson=numeric(175))

for (i in 1:175) {

DurbinWatson_residuals_CAPM[i,]<-dwtest(lm(ReturnsaboveRf[,i]~RiskMarketPremium), alt='two.sided')$p.value

}

autocor_CAPM<-data.frame(Autocorrelation=numeric(175))

for (i in 1:175) {

autocor_CAPM[i,]<- if (DurbinWatson_residuals_CAPM[i,]<0.05) {1} else {0}

}

sum(autocor_CAPM)

#how to make random residuals

randomRes_Brent_Rub<-sample(nrow(Residuals_Brent_Rub))

ResidualsRandom_Brent_Rub<-Residuals_Brent_Rub[randomRes_Brent_Rub,]

#how to restore returns from residuals with zero alpha to get pseudo returns

#checking we are doing it right

Regression_Alpha_Brent_Rub[1,1]

Beta1_Brent_Rub[1,1]

Beta2_Brent_Rub[1,1]

Beta3_Brent_Rub[1,1]

RiskMarketPremium[1]

Residuals_Brent_Rub[1,1]

Regression_Alpha_Brent_Rub[1,1]+Beta1_Brent_Rub[1,1]*RiskMarketPremium[1]+Beta2_Brent_Rub[1,1]*Brent_returns[1]+Beta3_Brent_Rub[1,1]*UsdRub_returns[1]+Residuals_Brent_Rub[1,1]

ReturnsaboveRf[1,1]

#Now back to pseudo returns

NewReturns_Brent_Rub<-data.frame(Returns=numeric(2209))

NewReturns_Brent_Rub[,1]=Beta1_Brent_Rub[1,1]*RiskMarketPremium+Beta2_Brent_Rub[1,1]*Brent_returns+Beta3_Brent_Rub[1,1]*UsdRub_returns+ResidualsRandom_Brent_Rub[,1]

#how to get pseudo alpha from pseudo returns

lm(NewReturns_Brent_Rub[,1]~RiskMarketPremium+Brent_returns+UsdRub_returns)

New_Alpha<-summary(lm(NewReturns_Brent_Rub[,1]~RiskMarketPremium+Brent_returns+UsdRub_returns))$coefficients[1,1]

########################################

#Now we can create a loop

##Brent_Rub loop

Boot_Alpha_Brent_Rub<-matrix(nrow=1000,ncol=175)

colnames(Boot_Alpha_Brent_Rub)=colnames(Funds_returns_adj)

for (j in 1:1000) {

Pseudo_RaRF_Brent_Rub<-matrix(nrow=2209,ncol=175)

colnames(Pseudo_RaRF_Brent_Rub)=colnames(Funds_returns_adj)

RR_Brent_Rub<-matrix(nrow=2209, ncol=175)

for (i in 1:175) {

RR_Brent_Rub[,i]<-cbind(rbind(sample(Residuals_Brent_Rub[1:n_observations[i],i],replace=TRUE))[1:2209])

}

for (i in 1:175) {

Pseudo_RaRF_Brent_Rub[,i]<-Beta1_Brent_Rub[i,1]*RiskMarketPremium+Beta2_Brent_Rub[i,1] *Brent_returns+Beta3_Brent_Rub[i,1]*UsdRub_returns+RR_Brent_Rub[,i]

}

for (n in 1:175) {

Boot_Alpha_Brent_Rub[j,n]<-summary(lm(Pseudo_RaRF_Brent_Rub[,n]~RiskMarketPremium+Brent_returns+UsdRub_returns, na.action=na.exclude))$coefficients[1,1]

}

}

##BrentRub loop

Boot_Alpha_BrentRub<-matrix(nrow=1000,ncol=175)

colnames(Boot_Alpha_BrentRub)=colnames(Funds_returns_adj)

for (j in 1:1000) {

Pseudo_RaRF_BrentRub<-matrix(nrow=2209,ncol=175)

colnames(Pseudo_RaRF_BrentRub)=colnames(Funds_returns_adj)

RR_BrentRub<-matrix(nrow=2209, ncol=175)

for (i in 1:175) {

RR_BrentRub[,i]<-cbind(rbind(sample(Residuals_BrentRub[1:n_observations[i],i],replace=TRUE))[1:2209])

}

for (i in 1:175) {

Pseudo_RaRF_BrentRub[,i]<-Beta1_BrentRub[i,1]*RiskMarketPremium+Beta2_BrentRub[i,1]*BrentRub_returns+ RR_BrentRub[,i]

}

for (n in 1:175) {

Boot_Alpha_BrentRub[j,n]<-summary(lm(Pseudo_RaRF_BrentRub[,n]~RiskMarketPremium+BrentRub_returns, na.action=na.exclude))$coefficients[1,1]

}

}

##CAPM loop

Boot_Alpha_CAPM<-matrix(nrow=1000,ncol=175)

colnames(Boot_Alpha_CAPM)=colnames(Funds_returns_adj)

for (j in 1:1000) {

Pseudo_RaRF_CAPM<-matrix(nrow=2209,ncol=175)

colnames(Pseudo_RaRF_CAPM)=colnames(Funds_returns_adj)

RR_CAPM<-matrix(nrow=2209, ncol=175)

for (i in 1:175) {

RR_CAPM[,i]<-cbind(rbind(sample(Residuals_CAPM[1:n_observations[i],i],replace=TRUE))[1:2209])

}

for (i in 1:175) {

Pseudo_RaRF_CAPM[,i]<-Beta1_CAPM[i,1]*RiskMarketPremium+RR_CAPM[,i]

}

for (n in 1:175) {

Boot_Alpha_CAPM[j,n]<-summary(lm(Pseudo_RaRF_CAPM[,n]~RiskMarketPremium, na.action=na.exclude))$coefficients[1,1]

}

}

########################################

#Real and bootstrap alphas qus

summary(as.vector(Boot_Alpha_Brent_Rub))

sd(as.vector(Boot_Alpha_Brent_Rub))

summary(Regression_Alpha_Brent_Rub[,])

summary(as.vector(Boot_Alpha_BrentRub))

sd(as.vector(Boot_Alpha_BrentRub))

summary(Regression_Alpha_BrentRub[,])

summary(as.vector(Boot_Alpha_CAPM))

sd(as.vector(Boot_Alpha_CAPM))

summary(Regression_Alpha_CAPM[,])

##These alphas represents luck

plot(density(Boot_Alpha_Brent_Rub), type = "l", col = "black", main = "Bootstrap Alpha for Brent and USDRub", xlab = "Alpha", ylab = "density", xlim=c(-0.0017,0.0017), ylim=c(0,1400))

lines(density(Regression_Alpha_BrentRub[,]), lty=2, col="red", )

abline(v =0, col="red")

plot(density(Boot_Alpha_BrentRub), type = "l", col = "black", main = "Bootstrap Alpha for Brent in Rub", xlab = "Alpha", ylab = "density", xlim=c(-0.001,0.001))

abline(v =0, col="red")

plot(density(Boot_Alpha_CAPM), type = "l", col = "black", main = "Bootstrap Alpha for CAPM", xlab = "Alpha", ylab = "density", xlim=c(-0.001,0.001))

abline(v =0, col="red")

#Now we should make 95% interval

Boot_Alpha_Sorted_Brent_Rub<-apply(Boot_Alpha_Brent_Rub, 2, sort)

Bad_skill_25_alphas_Brent_Rub<-(Boot_Alpha_Sorted_Brent_Rub[25,]+Boot_Alpha_Sorted_Brent_Rub[26,])/2

Good_skill_25_alphas_Brent_Rub<-(Boot_Alpha_Sorted_Brent_Rub[974,]+Boot_Alpha_Sorted_Brent_Rub[975,])/2

Bad_skill_50_alphas_Brent_Rub<-(Boot_Alpha_Sorted_Brent_Rub[50,]+Boot_Alpha_Sorted_Brent_Rub[51,])/2

Good_skill_50_alphas_Brent_Rub<-(Boot_Alpha_Sorted_Brent_Rub[949,]+Boot_Alpha_Sorted_Brent_Rub[950,])/2

Boot_Alpha_Sorted_BrentRub<-apply(Boot_Alpha_BrentRub, 2, sort)

Bad_skill_25_alphas_BrentRub<-(Boot_Alpha_Sorted_BrentRub[25,]+Boot_Alpha_Sorted_BrentRub[26,])/2

Good_skill_25_alphas_BrentRub<-(Boot_Alpha_Sorted_BrentRub[974,]+Boot_Alpha_Sorted_BrentRub[975,])/2

Bad_skill_50_alphas_BrentRub<-(Boot_Alpha_Sorted_BrentRub[50,]+Boot_Alpha_Sorted_BrentRub[51,])/2

Good_skill_50_alphas_BrentRub<-(Boot_Alpha_Sorted_BrentRub[949,]+Boot_Alpha_Sorted_BrentRub[950,])/2

Boot_Alpha_Sorted_CAPM<-apply(Boot_Alpha_CAPM, 2, sort)

Bad_skill_25_alphas_CAPM<-(Boot_Alpha_Sorted_CAPM[25,]+Boot_Alpha_Sorted_CAPM[26,])/2

Good_skill_25_alphas_CAPM<-(Boot_Alpha_Sorted_CAPM[974,]+Boot_Alpha_Sorted_CAPM[975,])/2

Bad_skill_50_alphas_CAPM<-(Boot_Alpha_Sorted_CAPM[50,]+Boot_Alpha_Sorted_CAPM[51,])/2

Good_skill_50_alphas_CAPM<-(Boot_Alpha_Sorted_CAPM[949,]+Boot_Alpha_Sorted_CAPM[950,])/2

#Compare funds alphas with bootstrap bad and good results

Res_25_Brent_Rub<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_25_Brent_Rub[i,]<-if (Regression_Alpha_Brent_Rub[i,] > Good_skill_25_alphas_Brent_Rub[i]) {1}

else {if (Regression_Alpha_Brent_Rub[i,] < Bad_skill_25_alphas_Brent_Rub[i]) {-1} else {0}}

}

NumResSkill_25_Brent_Rub<-data.frame(Result_Brent_Rub=numeric(175))

for (i in 1:175) {

NumResSkill_25_Brent_Rub[i,]<-if (Res_25_Brent_Rub[i,]==1) {1} else {0}

}

sum(NumResSkill_25_Brent_Rub)

NumResBad_25_Brent_Rub<-data.frame(Result_Brent_Rub=numeric(175))

for (i in 1:175) {

NumResBad_25_Brent_Rub[i,]<-if (Res_25_Brent_Rub[i,]== -1) {1} else {0}

}

sum(NumResBad_25_Brent_Rub)

Res_50_Brent_Rub<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_50_Brent_Rub[i,]<-if (Regression_Alpha_Brent_Rub[i,] > Good_skill_50_alphas_Brent_Rub[i]) {1}

else {if (Regression_Alpha_Brent_Rub[i,] < Bad_skill_50_alphas_Brent_Rub[i]) {-1} else {0}}

}

NumResSkill_50_Brent_Rub<-data.frame(Result_Brent_Rub=numeric(175))

for (i in 1:175) {

NumResSkill_50_Brent_Rub[i,]<-if (Res_50_Brent_Rub[i,]==1) {1} else {0}

}

sum(NumResSkill_50_Brent_Rub)

NumResBad_50_Brent_Rub<-data.frame(Result_Brent_Rub=numeric(175))

for (i in 1:175) {

NumResBad_50_Brent_Rub[i,]<-if (Res_50_Brent_Rub[i,]== -1) {1} else {0}

}

sum(NumResBad_50_Brent_Rub)

##

Res_25_BrentRub<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_25_BrentRub[i,]<-if (Regression_Alpha_BrentRub[i,] > Good_skill_25_alphas_BrentRub[i]) {1}

else {if (Regression_Alpha_BrentRub[i,] < Bad_skill_25_alphas_BrentRub[i]) {-1} else {0}}

}

NumResSkill_25_BrentRub<-data.frame(Result_BrentRub=numeric(175))

for (i in 1:175) {

NumResSkill_25_BrentRub[i,]<-if (Res_25_BrentRub[i,]==1) {1} else {0}

}

sum(NumResSkill_25_BrentRub)

NumResBad_25_BrentRub<-data.frame(Result_BrentRub=numeric(175))

for (i in 1:175) {

NumResBad_25_BrentRub[i,]<-if (Res_25_BrentRub[i,]== -1) {1} else {0}

}

sum(NumResBad_25_BrentRub)

Res_50_BrentRub<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_50_BrentRub[i,]<-if (Regression_Alpha_BrentRub[i,] > Good_skill_50_alphas_BrentRub[i]) {1}

else {if (Regression_Alpha_BrentRub[i,] < Bad_skill_50_alphas_BrentRub[i]) {-1} else {0}}

}

NumResSkill_50_BrentRub<-data.frame(Result_BrentRub=numeric(175))

for (i in 1:175) {

NumResSkill_50_BrentRub[i,]<-if (Res_50_BrentRub[i,]==1) {1} else {0}

}

sum(NumResSkill_50_BrentRub)

NumResBad_50_BrentRub<-data.frame(Result_BrentRub=numeric(175))

for (i in 1:175) {

NumResBad_50_BrentRub[i,]<-if (Res_50_BrentRub[i,]== -1) {1} else {0}

}

sum(NumResBad_50_BrentRub)

##

Res_25_CAPM<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_25_CAPM[i,]<-if (Regression_Alpha_CAPM[i,] > Good_skill_25_alphas_CAPM[i]) {1}

else {if (Regression_Alpha_CAPM[i,] < Bad_skill_25_alphas_CAPM[i]) {-1} else {0}}

}

NumResSkill_25_CAPM<-data.frame(Result_CAPM=numeric(175))

for (i in 1:175) {

NumResSkill_25_CAPM[i,]<-if (Res_25_CAPM[i,]==1) {1} else {0}

}

sum(NumResSkill_25_CAPM)

NumResBad_25_CAPM<-data.frame(Result_CAPM=numeric(175))

for (i in 1:175) {

NumResBad_25_CAPM[i,]<-if (Res_25_CAPM[i,]== -1) {1} else {0}

}

sum(NumResBad_25_CAPM)

Res_50_CAPM<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_50_CAPM[i,]<-if (Regression_Alpha_CAPM[i,] > Good_skill_50_alphas_CAPM[i]) {1}

else {if (Regression_Alpha_CAPM[i,] < Bad_skill_50_alphas_CAPM[i]) {-1} else {0}}

}

NumResSkill_50_CAPM<-data.frame(Result_CAPM=numeric(175))

for (i in 1:175) {

NumResSkill_50_CAPM[i,]<-if (Res_50_CAPM[i,]==1) {1} else {0}

}

sum(NumResSkill_50_CAPM)

NumResBad_50_CAPM<-data.frame(Result_CAPM=numeric(175))

for (i in 1:175) {

NumResBad_50_CAPM[i,]<-if (Res_50_CAPM[i,]== -1) {1} else {0}

}

sum(NumResBad_50_CAPM)

###############Funds Alphas and their skill###############

###For 2.5%

Compare_25<-matrix(nrow=175,ncol=12)

rownames(Compare_25)=colnames(Funds_returns_adj)

colnames(Compare_25)<-c("Real_Brent_Rub", "Good_Skill_Brent_Rub", "Bad_Skill_Brent_Rub", "Skill_Brent_Rub","Real_BrentRub", "Good_Skill_BrentRub", "Bad_Skill_BrentRub", "Skill_BrentRub","Real_CAPM", "Good_Skill_CAPM", "Bad_Skill_CAPM", "Skill_CAPM")

for (i in 1:175) {

Compare_25[i,1]<-Regression_Alpha_Brent_Rub[i,]

Compare_25[i,2]<-Good_skill_25_alphas_Brent_Rub[i]

Compare_25[i,3]<-Bad_skill_25_alphas_Brent_Rub[i]

Compare_25[i,4]<-Res_25_Brent_Rub[i,]

Compare_25[i,5]<-Regression_Alpha_BrentRub[i,]

Compare_25[i,6]<-Good_skill_25_alphas_BrentRub[i]

Compare_25[i,7]<-Bad_skill_25_alphas_BrentRub[i]

Compare_25[i,8]<-Res_25_BrentRub[i,]

Compare_25[i,9]<-Regression_Alpha_CAPM[i,]

Compare_25[i,10]<-Good_skill_25_alphas_CAPM[i]

Compare_25[i,11]<-Bad_skill_25_alphas_CAPM[i]

Compare_25[i,12]<-Res_25_CAPM[i,]

}

attach(mtcars)

par(mfrow=c(2,1))

plot(Regression_Alpha_Brent_Rub[,], main = "Brent and Rub Result", xlab="fund")

abline(h=0, col="blue")

lines(Good_skill_25_alphas_Brent_Rub, col="green")

lines(Bad_skill_25_alphas_Brent_Rub, col="red")

plot(Compare_25[,4], ylim= c(-1,1), ylab="skill", xlab="fund")

plot(Regression_Alpha_BrentRub[,], main = "Brent in Rub Result", xlab="fund")

abline(h=0, col="blue")

lines(Good_skill_25_alphas_BrentRub, col="green")

lines(Bad_skill_25_alphas_BrentRub, col="red")

plot(Compare_25[,8], ylim= c(-1,1), ylab="skill", xlab="fund")

plot(Regression_Alpha_CAPM[,], main = "CAPM Result", xlab="fund")

abline(h=0, col="blue")

lines(Good_skill_25_alphas_CAPM, col="green")

lines(Bad_skill_25_alphas_CAPM, col="red")

plot(Compare_25[,12], ylab="skill", xlab="fund")

###For 5%

Compare_50<-matrix(nrow=175,ncol=12)

rownames(Compare_50)=colnames(Funds_returns_adj)

colnames(Compare_50)<-c("Real_Brent_Rub", "Good_Skill_Brent_Rub", "Bad_Skill_Brent_Rub", "Skill_Brent_Rub","Real_BrentRub", "Good_Skill_BrentRub", "Bad_Skill_BrentRub", "Skill_BrentRub","Real_CAPM", "Good_Skill_CAPM", "Bad_Skill_CAPM", "Skill_CAPM")

for (i in 1:175) {

Compare_50[i,1]<-Regression_Alpha_Brent_Rub[i,]

Compare_50[i,2]<-Good_skill_50_alphas_Brent_Rub[i]

Compare_50[i,3]<-Bad_skill_50_alphas_Brent_Rub[i]

Compare_50[i,4]<-Res_50_Brent_Rub[i,]

Compare_50[i,5]<-Regression_Alpha_BrentRub[i,]

Compare_50[i,6]<-Good_skill_50_alphas_BrentRub[i]

Compare_50[i,7]<-Bad_skill_50_alphas_BrentRub[i]

Compare_50[i,8]<-Res_50_BrentRub[i,]

Compare_50[i,9]<-Regression_Alpha_CAPM[i,]

Compare_50[i,10]<-Good_skill_50_alphas_CAPM[i]

Compare_50[i,11]<-Bad_skill_50_alphas_CAPM[i]

Compare_50[i,12]<-Res_50_CAPM[i,]

}

attach(mtcars)

par(mfrow=c(2,1),ask=F)

plot(Regression_Alpha_Brent_Rub[,], main = "Brent and Rub Result", xlab="fund")

abline(h=0, col="blue")

lines(Good_skill_50_alphas_Brent_Rub, col="green")

lines(Bad_skill_50_alphas_Brent_Rub, col="red")

plot(Compare_50[,4], ylab="skill", xlab="fund")

plot(Regression_Alpha_BrentRub[,], main = "Brent in Rub Result", xlab="fund")

abline(h=0, col="blue")

lines(Good_skill_50_alphas_BrentRub, col="green")

lines(Bad_skill_50_alphas_BrentRub, col="red")

plot(Compare_50[,8], ylab="skill", xlab="fund")

plot(Regression_Alpha_CAPM[,], main = "CAPM Result", xlab="fund")

abline(h=0, col="blue")

lines(Good_skill_50_alphas_CAPM, col="green")

lines(Bad_skill_50_alphas_CAPM, col="red")

plot(Compare_50[,12], ylab="skill", xlab="fund")

#####With pseuode residuals with 2209 observations######

##Brent_Rub loop 2209

Boot_Alpha_Brent_Rub_2209<-matrix(nrow=1000,ncol=175)

colnames(Boot_Alpha_Brent_Rub_2209)=colnames(Funds_returns_adj)

for (j in 1:1000) {

RandomRes_Brent_Rub_2209<-matrix(nrow=2209,ncol=175)

colnames(RandomRes_Brent_Rub_2209)=colnames(Funds_returns_adj)

Pseudo_RaRF_Brent_Rub_2209<-matrix(nrow=2209,ncol=175)

colnames(Pseudo_RaRF_Brent_Rub_2209)=colnames(Funds_returns_adj)

for (k in 1:175) {

RandomRes_Brent_Rub_2209[,k]<-sample(na.omit(Residuals_Brent_Rub[,k]), size=2209, replace=T)

}

for (i in 1:175) {

Pseudo_RaRF_Brent_Rub_2209[,i]<-Beta1_Brent_Rub[i,1]*RiskMarketPremium+Beta2_Brent_Rub[i,1]*Brent_returns+Beta3_Brent_Rub[i,1]*UsdRub_returns+RandomRes_Brent_Rub_2209[,i]

}

for (n in 1:175) {

Boot_Alpha_Brent_Rub_2209[j,n]<-summary(lm(Pseudo_RaRF_Brent_Rub_2209[,n]~RiskMarketPremium+Brent_returns+UsdRub_returns))$coefficients[1,1]

}

}

summary(as.vector(Boot_Alpha_Brent_Rub_2209[,]))

sd(as.vector(Boot_Alpha_Brent_Rub_2209[,]))

summary(Regression_Alpha_Brent_Rub[,])

plot(density(Boot_Alpha_Brent_Rub_2209), type = "l", col = "black", main = "Bootstrap Alpha for Brent and USDRub", xlab = "Alpha", ylab = "density", xlim=c(-0.001,0.001))

abline(v =0, col="red")

Boot_Alpha_Sorted_Brent_Rub_2209<-apply(Boot_Alpha_Brent_Rub_2209, 2, sort)

Bad_skill_25_alphas_Brent_Rub_2209<-(Boot_Alpha_Sorted_Brent_Rub_2209[25,]+Boot_Alpha_Sorted_Brent_Rub_2209[26,])/2

Good_skill_25_alphas_Brent_Rub_2209<-(Boot_Alpha_Sorted_Brent_Rub_2209[974,]+Boot_Alpha_Sorted_Brent_Rub_2209[975,])/2

Bad_skill_50_alphas_Brent_Rub_2209<-(Boot_Alpha_Sorted_Brent_Rub_2209[50,]+Boot_Alpha_Sorted_Brent_Rub_2209[51,])/2

Good_skill_50_alphas_Brent_Rub_2209<-(Boot_Alpha_Sorted_Brent_Rub_2209[949,]+Boot_Alpha_Sorted_Brent_Rub_2209[950,])/2

Res_25_Brent_Rub_2209<-data.frame(Skill=numeric(175))

for (i in 1:175) {

Res_25_Brent_Rub_2209[i,]<-if (Regression_Alpha_Brent_Rub[i,] > Good_skill_25_alphas_Brent_Rub_2209[i]) {1}

else {if (Regression_Alpha_Brent_Rub[i,] < Bad_skill_25_alphas_Brent_Rub_2209[i]) {-1} else {0}}

}

NumResSkill_25_Brent_Rub_2209<-data.frame(Result_Brent_Rub_2209=numeric(175))

for (i in 1:175) {

NumResSkill_25_Brent_Rub_2209[i,]<-if (Res_25_Brent_Rub_2209[i,]==1) {1} else {0}

...

Подобные документы

  • The concept, types and regulation of financial institutions. Their main functions: providing insurance and loans, asset swaps market participants. Activities and basic operations of credit unions, brokerage firms, investment funds and mutual funds.

    реферат [14,0 K], добавлен 01.12.2010

  • Economic essence of off-budget funds, the reasons of their occurrence. Pension and insurance funds. National fund of the Republic of Kazakhstan. The analysis of directions and results of activity of off-budget funds. Off-budget funds of local controls.

    курсовая работа [29,4 K], добавлен 21.10.2013

  • The General Economic Conditions for the Use of Money. Money and Money Substitutes. The Global Money Markets. US Money Market. Money Management. Cash Management for Finance Managers. The activity of financial institutions in the money market involves.

    реферат [20,9 K], добавлен 01.12.2006

  • Strategy of foreign capital regulation in Russia. Russian position in the world market of investments. Problems of foreign investments attraction. Types of measures for attraction of investments. Main aspects of foreign investments attraction policy.

    реферат [20,8 K], добавлен 16.05.2011

  • Theoretical aspects of accumulation pension system. Analysis of current status and development of accumulative pension system in Kazakhstan. Ways to improve the pension system and enhancing its social significance accumulative pension fund provision.

    курсовая работа [1,1 M], добавлен 06.11.2013

  • Тhe balance sheet company's financial condition is divided into 2 kinds: personal and corporate. Each of these species has some characteristics and detail information about the assets, liabilities and provided shareholders' equity of the company.

    реферат [409,2 K], добавлен 25.12.2008

  • Types and functions exchange. Conjuncture of exchange market in theory. The concept of the exchange. Types of Exchanges and Exchange operations. The concept of market conditions, goals, and methods of analysis. Stages of market research product markets.

    курсовая работа [43,3 K], добавлен 08.02.2014

  • Capital Structure Definition. Trade-off theory explanation to determine the capital structure. Common factors having most impact on firm’s capital structure in retail sector. Analysis the influence they have on the listed firm’s debt-equity ratio.

    курсовая работа [144,4 K], добавлен 16.07.2016

  • Методы и показатели оценки ликвидности. Разделение актива и пассива баланса по степени ликвидности. Абсолютные и относительные показатели ликвидности. Повышение ликвидности за счет автоматизации бюджетирования и с помощью продуктов Cash Management.

    дипломная работа [2,6 M], добавлен 26.06.2017

  • Study credit channel using clustering and test the difference in mean portfolio returns. The calculated debt-to-capital, interest coverage, current ratio, payables turnover ratio. Analysis of stock market behavior. Comparison of portfolios’ performances.

    курсовая работа [1,5 M], добавлен 23.10.2016

  • The Swiss tax system. Individual Income Tax. Income from capital gains. Procedure for taxation of income from capital gains. Distribution of shares in the capital. Tax at the source. The persons crossing the border. Lump-sum taxation. The gift tax.

    реферат [14,1 K], добавлен 21.06.2013

  • Fisher Separation Theorem. Consumption Vs. Investment. Utility Analysis. Indifference Curves. The satisfaction levels. Indifference Curves and Trade Off between Present and Future Consumptions. Marginal Rate of Substitution. Capital Market Line.

    презентация [1,5 M], добавлен 22.06.2015

  • History of formation and development of FRS. The organizational structure of the U.S Federal Reserve. The implementation of Monetary Policy. The Federal Reserve System in international sphere. Foreign Currency Operations and Resources, the role banks.

    реферат [385,4 K], добавлен 01.07.2011

  • Example of a bond valuing. Bond prices and yields. Stocks and stock market. Valuing common stocks. Capitalization rate. Constant growth DDM. Payout and plowback ratio. Assuming the dividend. Present value of growth opportunities. Sustainable growth rate.

    презентация [748,8 K], добавлен 02.08.2013

  • The primary goals and principles of asset management companies. The return of bank loans. Funds that are used as a working capital. Management perfection by material resources. Planning of purchases of necessary materials. Uses of modern warehouses.

    реферат [14,4 K], добавлен 13.05.2013

  • Legal regulation of the activities of foreign commercial banks. Features of the Russian financial market. The role and place of foreign banks in the credit and stock market. Services of foreign banks in the financial market on the example of Raiffeisen.

    дипломная работа [2,5 M], добавлен 27.10.2015

  • Amortization as a gradual transfer process of fixed assets cost on production price with the purpose of funds accumulation for subsequent repairing. Linear method, disadvantage. Depreciation methods for the sum of years number of the useful term use.

    доклад [17,9 K], добавлен 07.05.2013

  • The literary and art bohemia sharply opposing to weight, singularity and sharpness of experiences. The magic, spiritism and theosophy for works of art. The statement on a boundary of centuries. The role in the "Silver age" of Russian symbolists.

    реферат [16,3 K], добавлен 24.11.2010

  • Russian folk traditions and customs are respected for centuries among rural residents and among the townspeople. Festive and ceremonial culture. Russian wedding rite. Baptism as ritual that marks the beginning of life. Russian folklore and amulets.

    презентация [1,0 M], добавлен 19.03.2015

  • A. Nikitin as the russian traveler, writer. Peculiarities of the russian traveler trips. An abundance of factual material Nikitin as a valuable source of information about India at that time. Characteristics of records "Journey beyond three seas".

    презентация [671,3 K], добавлен 03.05.2013

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.