版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
Part pdfandPart MethodofPart OLSPart Part PartI.pdfandY= Y=Y= Y=Y= Y=‘bino’orn:numberofp:probabilityof‘poiss’orlambda:-‘unif’ora:lowerB:upper‘norm’ormu:%Bernoulli%N=100 pdf1=pdf(‘bino’,X1,N,p); %Bernoulli分布的pdfcdf1=cdf('bino',X1,N,p); %Bernoulli分布的cdf pdfandcdfforBernoulliNormal%Normal% %mu: %sigma:standarddeviationpdf4=pdf('norm',X4,mu,sigma);cdf4=cdf('norm',X4,mu,sigma);pdfandcdfforNormal%Poisson%lambda=3pdf2=pdf('poiss',X2,lambda);cdf2=cdf('poiss',X2,lambda);%Uniform%U(1,2)pdf3=cdf3=cdf('unif',X3,a,b);PartII.MethodofDataforPartCenterforResearchinSecurityPrices(CRSP)Marketreturn(Rm),value-weightreturnofallCRSPfirmsincorporatedintheUSandlistedontheNYSE,AMEX,orNASDAQthathaveaCRSPsharecodeof10or11atthebeginningofmontht,goodsharesandpricedataatthebeginningoft,andgoodreturndatafort.Matlabhasfunctionsforcomputingthemoments:data=xlsread(‘dataforweek1.xlsx’,‘Sheet2’); %sample %skewness(X,flag),setflag=0tocorrectthebias %kurtosis(X,flag),setflag=0tocorrectthebiasUsingtheOrwecancalculatethemomentsusingthe %Tocorrectthebias,divide(T-1)JarqueBeraJarqueBeratestfor%JB 正態(tài)分布假設(shè)下,JB~c2Matlabhasthefunction“jbtest”as(Notnormal)PartIII.OLSOrdinaryLeastSquares:minimizethesumofsquared Rp- FamaFrenchthreefactorE(Rp)=Rf+
(E(RM)-Rf)+bsSMB+bbRp-Rf=a+bm(E(RM)-Rf)+bsSMB+bbHML+DataforPartIII-DataFamaE.F.,K.R.French,Commonriskfactorsinthereturnsonstocksandbonds,1993,JournalofFinancialEconomics,Vol.33,3-56CenterforResearchinSecurityPrices(CRSP)datalibrary.html1926.07-2015.07,DataSampleRm:marketreturnasinPartRf:one-monthTreasurybillrate(fromIbbotsonSMB=1/3(SmallValue+SmallNeutral+SmallGrowth)-1/3(BigValue+BigNeutral+BigGrowth).HML=1/2(SmallValue+BigValue)-1/2(SmallGrowth+BigGrowth).Rp:Portfolioreturns.Theportfoliosaretheintersectionsof5portfoliosformedonsize(marketequity,ME)and5portfoliosformedontheratioofbookequitytomarketequityCodes:ols xpxi= results.yhat=x*results.beta;results.resid=y-results.yhat;results.sige=sigu/(nobs-nvar);tmp results.tstat=results.beta./(sqrt(tmp)); t統(tǒng)計(jì)量ym=y-mean(y);rsqr1=sigu;rsqr2=ym'*ym;results.rsqr=1.0- %R-Codes:data%OLS%load Codes:theta_capm %%Multivariate:Fama-FrenchThreeFactorModeltheta_ff=myols(y,Z);beta_capm=0.2827;tstats_capm=2.5164;58.7183(bothR2_capm=beta_ff=0.0473;0.9718;0.8268;tstats_ff=0.9094;94.3476;49.0097;(ThethreefactorsareallR2_ff=T
? tn(q)
Null
H0:q=r(b)=??'?? r(b?)' fic2Codes:t- xpxi= results.yhat=x*results.beta;results.resid=y-results.yhat;results.sige=sigu/(nobs-nvar);tmp Codes:Waldtest%WaldtestforCAPM(univariate)EstCov=sigma2*inv(X'*X);wald=(R*theta_capm.beta-Q)'*inv(R*EstCov*R')*(R*theta_capm.beta-Q);pvalue=1-chi2cdf(wald,1); h=1(rejectthenull);pValue=0;Wald=3454(squareoft-%Asymptoticdistribution:chi2 pdf5=title('Chisquarepdf');Codes:WaldtestNull b1=b2=b3=%Hypothesis(dataloadingisthesameasinPartIII,%WaldtestforFF(multivariate)theta_ff=myols(y,X);R=[0100;0010;000Q=Codes:Waldtestsigma2=EstCov=sigma2*(X'*X)^(-1); %EstCov= wald=(R*beta_ff-Q)'*inv(R*EstCov*R')*(R*beta_ff-Q);pvalue=1-chi2cdf(wald,3);wald= pvalue=2.8283e-04(Rejectthe pdf=pdf('chi2',X,nu);f(y;q)
Rp- =a+bm(E(RM)-Rf)+bsSMB+bbHML+Thefunctionsareallforminimization,andifwewanttomaximizeafunction,wecanminimizethenegativevalue.[x,fval,exitflag]=fminunc(@fun,x0,X0:initialfval:minimumvalueoftheexitflag:theflagofexit,>0meansoptions選項(xiàng)結(jié)構(gòu) [[x,fval,exitflag]=fminsearch(@fun,x0,fminsearchissimilarwithfminsearchtakesthesimplexmethod單純形法andthusismoreefficientthanfminunc.[x,fval,exitflag]=fminbnd(@fun,x1,xn,Findtheminimumupon[x1,OptimizationinMatlabMLE:PoissonAsampleofT=4observations,yt={6,2,3,1},isdrawnfromthePoissondistributionf(y;q)
DerivetheloglikelihoodfunctionlnLT(q)Drawthegraphsfortheloglikelihoodfunction,theGradientfunctionandtheHessianfunction.Codes:Main Defineafunction[theta_hat,g,h]=syms ln_L=mean(y*log(theta)-theta-log(factorial(y))); %loglikelihoodfunctionG=diff(ln_L); %gradientfunctiontheta_hat= %SetG=0togettheta_hat=Codes:Plotlog-likelihoodtheta_1=0.01:0.01:15;G1=zeros(length(theta_1),1);H1=zeros(length(theta_1),1);fori=lnL1(i)=mean(y*log(theta_1(i))-theta_1(i)-log(factorial(y)));G1(i)=mean(y)/theta_1(i)-1;H1(i)=-axis([-115-20Codes:PlotGradientandaxis([-115-20200])axis([-0.515-3Codes:AssumetheerrorMain%MLE%load 2.Codes:Definethefunction[theta,vcov]=t=x=[ones(t,1)x1x2%Estimatethetheta_0=[0.9094;94.3476;49.0097;37.3852; %Initialoptions=theta=fminunc(@(theta)%Computethecovariancee=y-theta(1)-x1*theta(2)-x2*theta(3)-x3*theta(4);sig2hat=e'*e/t; =2.Codes:Definethel
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024訂購酒的購銷合同范本范文
- 專題6 課內(nèi)閱讀 (一)(知識(shí)盤點(diǎn)+試題)-2022-2023學(xué)年五年級(jí)語文下冊期末復(fù)習(xí)
- 城區(qū)生活垃圾焚燒發(fā)電工程PPP項(xiàng)目招投標(biāo)書范本
- 2024路沿石購銷合同
- 2024商鋪?zhàn)赓U標(biāo)準(zhǔn)合同范本
- 2024電子產(chǎn)品購銷合同格式模板
- 2024物業(yè)保潔勞務(wù)合同
- 2024股權(quán)轉(zhuǎn)讓委托合同標(biāo)準(zhǔn)范本
- 規(guī)劃課題申報(bào)范例:《習(xí)近平新時(shí)代中國特色社會(huì)主義思想學(xué)生讀本》教學(xué)研究(附可修改技術(shù)路線圖)
- 茶水贈(zèng)送合同(2篇)
- 電梯使用現(xiàn)場類隱患專項(xiàng)排查清單
- 一例下肢靜脈潰瘍患者的個(gè)案護(hù)理論文
- 危巖穩(wěn)定性計(jì)算表格-滑移式-傾倒式-墜落式-完整版
- 直播運(yùn)營團(tuán)隊(duì)組織架構(gòu)及崗位職責(zé)解析
- 肝膽外科運(yùn)用PDCA循環(huán)縮短三四類手術(shù)患者術(shù)后留置導(dǎo)尿的時(shí)間
- JCT640-2010 頂進(jìn)施工法用鋼筋混凝土排水管
- 注塑車間平面規(guī)劃圖OK
- 鎮(zhèn)衛(wèi)生院績效考核方案
- 9.2+積極投身創(chuàng)新實(shí)踐(高效教案)-【中職專用】中職思想政治《哲學(xué)與人生》(高教版2023基礎(chǔ)模塊)
- 【高中語文】《邏輯的力量》課件+統(tǒng)編版++選擇性必修上冊
評(píng)論
0/150
提交評(píng)論