在Mata中输入大矩阵

时间:2019-05-07 15:15:09

标签: stata

我想在mata中手动输入大矩阵:

mata:

 M=(.6292137, .5609011, .2026468, .5468456, .54993,   .5261484\  
    .9338231, .6984306, .1163066, .987264,  .3449739, .7189465\  
     .997658, .822699,  .4409166, .9547378, .3022764, .2960172\  
    .6721607, .7416288, .5707042, .4911027, .2467789, .3911087\  
    .4290972, .5038062, .6516842, .7514484, .2016013, .9225978\  
    .3230259, .0550283, .8308372, .9765408, .2945748, .0664539\  
    .8457566, .2603625, .0652255, .4727278, .8023747, .8199414\  
    .4933482, .6325456, .7968005, .1040476, .2518314, .9081864\  
    .8643241, .1455071, .3949147, .0984193, .2945703, .963169\  
    .7408876, .2866094, .8994266, .0956861, .0730024, .0633169\  
    .3008768, .6137649, .4186606, .8467412, .2082022, .3055841\  
    .0390413, .0405267, .7969238, .3358724, .6746453, .4334986\  
    .6255479, .9605073, .5201019, .5318847, .7250822, .4928864\  
    .5800205, .890493,  .0222021, .9798947, .1133313, .3284452\  
    .7429258, .1040603, .6578994, .8436455, .9182087, .4394713\  
    .7184782, .6070313, .1630165, .8225987, .7494639, .8411205\  
    .8115859, .8841211, .6571357, .8964981, .2960061, .8633803\  
    .8107751, .3102676, .8350152, .7955093, .3883448, .5895734\  
     .313646, .4548411, .0570736, .626348,  .7303737, .0994138\  
    .3438286, .2681752, .4007674, .0230035, .4329889, .9409589\  
    .6425273, .7541046, .7719912, .9717283, .5862143, .922036\  
    .2259182, .3082959, .8089946, .0310696, .3069796, .0386864\  
    .9980771, .3805493, .6000561, .8445307, .588245,  .5144665\  
    .5943489, .98513,   .7996946, .204635,  .9639818, .7296869\  
    .6074141, .3577864, .3199501, .4259032, .9909449, .486661\  
    .2473645, .8821727, .8986002, .0527823, .7918458, .9494621\  
    .9450907, .8995178, .177872,  .6901507, .4282079, .093545\  
    .1882574, .484151,  .8063351, .3834262, .4014561, .4190526\  
    .2927249, .864047,  .3188445, .7068417, .8514773, .4546837\  
    .2155348, .6671643, .5817582, .712261,  .4823096, .8172774\  
    .9490121, .9287962, .1001955, .6639749, .4882186, .6595466\  
    .2973817, .516189,  .289407,  .6276135, .5170875, .5319368\  
    .4705949, .0930524, .9443634, .7924257, .6275546, .2145773\  
    .5592234, .8012159, .7993056, .8182809, .611358,  .7408235\  
     .784788, .814846,  .4864607, .5479002, .9077195, .4829051\  
    .6796544, .7381238, .7479802, .1139289, .5743615, .5100503\  
    .1790906, .6315904, .8986604, .8139769, .4735439, .341276\  
    .9760152, .5296411, .5754572, .5694261, .8971185, .1232754\  
    .2953885, .0690686, .4173038, .9314196, .010954,  .1297689\  
     .592105, .0534653, .8418096, .3587537, .4433249, .7900795\  
    .5650685, .6940206, .5001324, .3158612, .7320505, .6424836\  
    .8485704, .1262538, .8519057, .4912878, .7426032, .0412038\  
    .6873636, .6532404, .9920368, .6446795, .7933023, .0882637\  
    .6081801, .2631427, .7027063, .9518121, .9372609, .9119475\  
    .6901931, .5838737, .4003244, .9726177, .6428731, .6249211\  
    .7071513, .1601286, .0026622, .6053908, .8056636, .3449988\  
    .8017052, .6833867, .4821162, .4929242, .239779,  .9586726\  
     .435684, .6760067, .9690186, .0421649, .3524112, .3285281\  
    .2078739, .9369418, .4347669, .4472602, .189126,  .6955702\  
    .9112108, .6128471, .6414735, .4714447, .1079472, .4312744)

end

但是,mata抱怨:

too many tokens
(9 lines skipped)
--------------------------------------------------------------------------------
r(3000);

在Stata中,如果一个人使用matrix define,则由于表达式 解析器必须编译表达式。但是,可以改用matrix input, 不受此限制。

是否可以通过程序直接mata中输入大型矩阵?

我知道我可以将矩阵分为两个部分,然后将它们合并,但是我试图 从文本文件解析它们,这不是理想的解决方案。

0 个答案:

没有答案