Hi all,
I was trying to use gmm command in STATA to do the CCAPM estimation. The equation is "gmm ({b=1}*(cratio^(-{g=1}))*rrate-1), inst(cratio1 rrate1 e1)". Where beta(b=1) , gamma (g=1), consumption ratio (cratio), risk free rate (rrate), value weighted returns(e), cratio1=cratio[_n-1], rrate1=rrate[_n-1], e1=e[_n-1]. When I run the code, I get the following error;
"could not calculate numerical derivatives -- discontinuous region with missing values encountered"
Any help will be much appreciated.
Regards,
Sydul
I was trying to use gmm command in STATA to do the CCAPM estimation. The equation is "gmm ({b=1}*(cratio^(-{g=1}))*rrate-1), inst(cratio1 rrate1 e1)". Where beta(b=1) , gamma (g=1), consumption ratio (cratio), risk free rate (rrate), value weighted returns(e), cratio1=cratio[_n-1], rrate1=rrate[_n-1], e1=e[_n-1]. When I run the code, I get the following error;
"could not calculate numerical derivatives -- discontinuous region with missing values encountered"
Any help will be much appreciated.
Regards,
Sydul
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float month str8 ticker float(cratio rrate e cratio1 rrate1 e1) 36 "BA" -3.540156 .0023 -.0215 . . . 37 "BA" -.971704 .0023 .0331 -3.540156 .0023 -.0215 38 "BA" -.4979921 .0025 .0476 -.971704 .0023 .0331 39 "BA" .06949931 .0024 .02 -.4979921 .0025 .0476 40 "BA" -19.39612 .0023 -.0177 .06949931 .0024 .02 41 "BA" .05247923 .0027 -.0012 -19.39612 .0023 -.0177 42 "BA" 30.49854 .0025 .0532 .05247923 .0027 -.0012 43 "BA" -1.3992133 .0027 -.013 30.49854 .0025 .0532 44 "BA" .4408814 .0029 .0282 -1.3992133 .0027 -.013 45 "BA" -.6460861 .0027 -.0058 .4408814 .0029 .0282 46 "BA" 2.73724 .0029 .0212 -.6460861 .0027 -.0058 47 "BA" -.24778116 .003 .0254 2.73724 .0029 .0212 48 "BA" -4.439967 .0026 .018 -.24778116 .003 .0254 49 "BA" .51613766 .0031 .0172 -4.439967 .0026 .018 50 "BA" -.7451285 .0029 .0039 .51613766 .0031 .0172 51 "BA" -5.061406 .0026 .0168 -.7451285 .0029 .0039 52 "BA" -.027067313 .003 .0157 -5.061406 .0026 .0168 53 "BA" -14.178907 .003 .0204 -.027067313 .003 .0157 54 "BA" .9381444 .0028 -.0116 -14.178907 .003 .0204 55 "BA" -1.2203156 .0028 .0297 .9381444 .0028 -.0116 56 "BA" -.51360977 .0029 .0088 -1.2203156 .0028 .0297 57 "BA" -3.746736 .0029 .0029 -.51360977 .0029 .0088 58 "BA" -1.5030264 .0031 .0034 -3.746736 .0029 .0029 59 "BA" -.2302539 .0028 .0382 -1.5030264 .0031 .0034 60 "BA" -1.8142532 .003 .0074 -.2302539 .0028 .0382 61 "BA" -1.4752742 .0036 -.0098 -1.8142532 .003 .0074 62 "BA" -.9928886 .0031 .0342 -1.4752742 .0036 -.0098 63 "BA" .25200903 .0031 -.0046 -.9928886 .0031 .0342 64 "BA" -3.1841326 .0035 -.0516 .25200903 .0031 -.0046 65 "BA" -1.2907373 .0031 .0174 -3.1841326 .0035 -.0516 66 "BA" -.06960047 .0033 .0306 -1.2907373 .0031 .0174 67 "BA" -9.199977 .0031 .0317 -.06960047 .0033 .0306 68 "BA" 2.988388 .0031 .0291 -9.199977 .0031 .0317 69 "BA" -.22622275 .0035 .0032 2.988388 .0031 .0291 70 "BA" -.4056587 .0033 .0134 -.22622275 .0035 .0032 71 "BA" 1.0434303 .0038 .011 -.4056587 .0033 .0134 72 "BA" .9252369 .0035 -.0086 1.0434303 .0038 .011 73 "BA" .3515978 .0038 -.0213 .9252369 .0035 -.0086 74 "BA" 9.300008 .0034 .0248 .3515978 .0038 -.0213 75 "BA" -.942119 .0041 -.0525 9.300008 .0034 .0248 76 "BA" -.8822408 .0038 -.0106 -.942119 .0041 -.0525 77 "BA" 1.1425195 .0035 -.0128 -.8822408 .0038 -.0106 78 "BA" -1.3333863 .0041 -.075 1.1425195 .0035 -.0128 79 "BA" -.28533137 .004 -.0066 -1.3333863 .0041 -.075 80 "BA" -1.6027147 .0045 .0431 -.28533137 .004 -.0066 81 "BA" -.5128761 .004 .018 -1.6027147 .0045 .0431 82 "BA" -.9553156 .004 .0053 -.5128761 .004 .018 83 "BA" -2.185487 .0043 .0858 -.9553156 .004 .0053 84 "BA" .9628142 .0036 .0114 -2.185487 .0043 .0858 85 "BA" .2040771 .0039 .0438 .9628142 .0036 .0114 86 "BA" 3.155706 .0032 .0421 .2040771 .0039 .0438 87 "BA" -.6790543 .0033 -.04 3.155706 .0032 .0421 88 "BA" -.9911674 .0027 .0268 -.6790543 .0033 -.04 89 "BA" -4.969764 .0031 .0489 -.9911674 .0027 .0268 90 "BA" -.57885915 .0031 -.0058 -4.969764 .0031 .0489 91 "BA" 1.1362848 .0032 .0343 -.57885915 .0031 -.0058 92 "BA" -2.2006211 .0039 -.027 1.1362848 .0032 .0343 93 "BA" -.59475595 .0036 .0073 -2.2006211 .0039 -.027 94 "BA" 1.406285 .0033 .0338 -.59475595 .0036 .0073 95 "BA" -.2034841 .004 -.0366 1.406285 .0033 .0338 96 "BA" -1.5376444 .0039 -.0336 -.2034841 .004 -.0366 97 "BA" 3.397366 .0038 .0058 -1.5376444 .0039 -.0336 98 "BA" -.4767671 .0043 .0948 3.397366 .0038 .0058 99 "BA" -.3951773 .0045 .0273 -.4767671 .0043 .0948 100 "BA" 4.3474393 .0043 .0112 -.3951773 .0045 .0273 101 "BA" .6482985 .0048 -.0224 4.3474393 .0043 .0112 102 "BA" -.009207793 .0042 .0176 .6482985 .0048 -.0224 103 "BA" 151.67432 .0043 .0446 -.009207793 .0042 .0176 104 "BA" -.04699334 .0044 .0086 151.67432 .0043 .0446 105 "BA" 26.181854 .0042 .0585 -.04699334 .0044 .0086 106 "BA" -1.0291973 .0043 -.0351 26.181854 .0042 .0585 107 "BA" -.6530969 .0053 -.0072 -1.0291973 .0043 -.0351 108 "BA" .9244005 .0046 -.0538 -.6530969 .0053 -.0072 109 "BA" -.25225097 .0046 .031 .9244005 .0046 -.0538 110 "BA" .9673108 .0053 .0199 -.25225097 .0046 .031 111 "BA" -4.165961 .0048 .0038 .9673108 .0053 .0199 112 "BA" -1.7049503 .0051 -.0667 -4.165961 .0048 .0038 113 "BA" -.3784493 .0053 -.0647 -1.7049503 .0051 -.0667 114 "BA" 1.717535 .005 .0518 -.3784493 .0053 -.0647 115 "BA" -1.251924 .0062 -.0236 1.717535 .005 .0518 116 "BA" -1.0894614 .006 .0566 -1.251924 .0062 -.0236 117 "BA" -.4745781 .0052 -.0327 -1.0894614 .006 .0566 118 "BA" .08973293 .0064 -.0199 -.4745781 .0052 -.0327 119 "BA" -22.325546 .006 -.075 .08973293 .0064 -.0199 120 "BA" -.6001403 .0062 .0575 -22.325546 .006 -.075 121 "BA" -.53734916 .0057 -.0049 -.6001403 .0062 .0575 122 "BA" -2.3501725 .005 -.105 -.53734916 .0057 -.0049 123 "BA" -.8619991 .0053 -.0639 -2.3501725 .005 -.105 124 "BA" .08436878 .0058 -.0521 -.8619991 .0053 -.0639 125 "BA" -3.303317 .0052 .0745 .08436878 .0058 -.0521 126 "BA" -.6669593 .0053 .0502 -3.303317 .0052 .0745 127 "BA" 3.671982 .0054 .0472 -.6669593 .0053 .0502 128 "BA" -.33949545 .0046 -.0182 3.671982 .0054 .0472 129 "BA" -1.257444 .0046 .0505 -.33949545 .0046 -.0182 130 "BA" 5.63779 .0042 .0614 -1.257444 .0046 .0505 131 "BA" -.3036467 .0038 .0522 5.63779 .0042 .0614 132 "BA" .22997028 .0033 .0174 -.3036467 .0038 .0522 133 "BA" 12.805146 .003 .0443 .22997028 .0033 .0174 134 "BA" -.8253033 .0028 .0343 12.805146 .003 .0443 135 "BA" -.6152521 .0029 -.0369 -.8253033 .0028 .0343 end format %tmNN/CCYY month
Comment