Changeset 0b95534 in tol
- Timestamp:
- Oct 3, 2012, 10:59:26 AM (14 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 6ee9a42
- Parents:
- 3f1b1319
- File:
-
- 1 edited
-
tol/btol/bmodel/estim.cpp (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/bmodel/estim.cpp
r3f1b1319 r0b95534 377 377 BList* lst = NIL; 378 378 BList* aux = NIL; 379 BGrammar::IncLevel(); 379 380 for(i=0; i<n; i++) 380 381 { … … 430 431 LstFastAppend(lst,aux,inf); 431 432 LstFastAppend(lst,aux,covInf); 432 433 433 contens_.RobElement(lst); 434 BGrammar::DecLevel(); 434 435 } 435 436 … … 515 516 BList* lst = NIL; 516 517 BList* aux = NIL; 518 BGrammar::IncLevel(); 517 519 for(i=0; i<n; i++) 518 520 { … … 573 575 LstFastAppend(lst,aux,covInf); 574 576 LstFastAppend(lst,aux,BContensPol::New("",pol, "ARI polyn")); 575 576 577 contens_.RobElement(lst); 578 BGrammar::DecLevel(); 577 579 } 578 580 … … 633 635 BList* lst = NIL; 634 636 BList* aux = NIL; 637 BGrammar::IncLevel(); 635 638 for(i=0; i<param.Size(); i++) 636 639 { … … 689 692 690 693 contens_.RobElement(lst); 694 BGrammar::DecLevel(); 691 695 } 692 696 … … 741 745 BList* lst = NIL; 742 746 BList* aux = NIL; 747 BGrammar::IncLevel(); 743 748 for(i=0; i<param.Size(); i++) 744 749 { … … 812 817 813 818 result.RobElement(lst); 819 BGrammar::DecLevel(); 814 820 } 815 821 … … 852 858 BDat lnLikelyhood; 853 859 BDat likelyhood; 860 BGrammar::IncLevel(); 854 861 855 862 Logit(y,X,B,e,p,G,H,lnL,lnLikelyhood,likelyhood); … … 866 873 LstFastAppend(lst,aux,BContensDat::New("", likelyhood, "Log of likelihood")); 867 874 contens_.RobElement(lst); 875 BGrammar::DecLevel(); 868 876 869 877 } … … 891 899 BDat lnLikelyhood; 892 900 BDat likelyhood; 901 BGrammar::IncLevel(); 893 902 894 903 Probit(y,X,B,e,p,G,H,lnL,lnLikelyhood,likelyhood); … … 905 914 LstFastAppend(lst,aux,BContensDat::New("", likelyhood, "Log of likelihood")); 906 915 contens_.RobElement(lst); 916 BGrammar::DecLevel(); 907 917 } 908 918 … … 1090 1100 BoxCoxTrans(exponent,addition,zTable.Data().Data(), period); 1091 1101 } 1102 BGrammar::IncLevel(); 1092 1103 BUserDat* exp = BContensDat::New("",exponent,I2("Exponent","Exponente")); 1093 1104 BUserDat* add = BContensDat::New("",addition,I2("Addition","Adición" )); 1094 1105 BList* lst = Cons(exp,NCons(add)); 1095 1106 contens_.RobStruct(lst,BoxCoxStruct_,BSet::Structured); 1107 BGrammar::DecLevel(); 1096 1108 } 1097 1109 … … 1213 1225 BList* result=NIL; 1214 1226 BList* aux=NIL; 1227 BGrammar::IncLevel(); 1215 1228 1216 1229 BUserMat* UX = BContensMat::New("X",X,I2("Parameters of the model","Parámetros del modelo")); … … 1297 1310 } 1298 1311 contens_.RobElement(result); 1312 BGrammar::DecLevel(); 1299 1313 } 1300 1314 … … 2071 2085 } 2072 2086 var /= double(N); 2087 BGrammar::IncLevel(); 2073 2088 BUserMat* Var = BContensMat::New("MaxLHVar",var, I2("Tra(W)*Inv(Cov)*W : Maximum likelihood estimated varianze of the model", 2074 2089 "Tra(W)*Inv(Cov)*W : Estimación máximo verosímil de la varianza del modelo")); … … 2181 2196 */ 2182 2197 contens_.RobElement(result); 2198 BGrammar::DecLevel(); 2183 2199 } 2184 2200 … … 2226 2242 BList* result=NIL; 2227 2243 BList* aux=NIL; 2244 BGrammar::IncLevel(); 2228 2245 LstFastAppend(result, aux, BContensMat::New("y", BMat(y.Size(),1,y.Buffer()), "Solution")); 2229 2246 LstFastAppend(result, aux, BContensMat::New("PCC", BMat(y.Size(),1,PACF.Buffer()), "Partial Correlation Coefficients")); 2230 2247 LstFastAppend(result, aux, BContensDat::New("LogDet",logDet, "Log(Det(T))")); 2231 2248 contens_.RobElement(result); 2249 BGrammar::DecLevel(); 2232 2250 /* */ 2233 2251 } … … 2276 2294 BMatrix<BDat> y_ (y .Size()-1,1,y .Buffer()+1); 2277 2295 BMatrix<BDat> PCF_(PCF.Size()-1,1,PCF.Buffer() ); 2296 BGrammar::IncLevel(); 2278 2297 LstFastAppend(result, aux, BContensMat::New("x",x_, "-Inv(T(r))*c")); 2279 2298 LstFastAppend(result, aux, BContensMat::New("y",y_, "-Inv(T(r))*R")); … … 2281 2300 LstFastAppend(result, aux, BContensDat::New("LogDet",logDet, "Log(Det(T(r)))")); 2282 2301 contens_.RobElement(result); 2302 BGrammar::DecLevel(); 2283 2303 } 2284 2304 … … 2339 2359 BMatrix<BDat> y_ (y .Size()-1,1,y .Buffer()+1); 2340 2360 BMatrix<BDat> PCF_(PCF.Size()-1,1,PCF.Buffer() ); 2361 BGrammar::IncLevel(); 2341 2362 LstFastAppend(result, aux, BContensMat::New("x",x_, "-Inv(T(r))*c")); 2342 2363 LstFastAppend(result, aux, BContensMat::New("y",y_, "-Inv(T(r))*R")); … … 2344 2365 LstFastAppend(result, aux, BContensDat::New("LogDet",logDet, "Log(Det(T(r)))")); 2345 2366 contens_.RobElement(result); 2367 BGrammar::DecLevel(); 2346 2368 } 2347 2369 … … 2482 2504 "Estimates a preliminary AR(p)MA(q) non seassonal model \n" 2483 2505 " \n" 2484 " (1-phi(B)) z[t] = (1-theta(B)) a[t] ; t = 1 ... N \n"2506 " phi(B) z[t] = theta(B) a[t] ; t = 1 ... N \n" 2485 2507 " \n" 2486 2508 " a ~ Normal(0,variance*I) \n" … … 2491 2513 "must be positive.\n" 2492 2514 "If success, it returns a Set with positive real variance and " 2493 "polynomials 1-phi(B) and 1-phi(B). Elsewhere it returns unknown variance." 2515 "polynomials phi(B) and theta(B). Elsewhere it returns unknown variance." 2516 "There is no control about stationarity of both polynomials." 2494 2517 "The algorithm is given by Box and Jenkins in their book" 2495 2518 "\n" … … 2534 2557 } 2535 2558 BList* result = NULL, *aux = NULL; 2536 LstFastAppend(result, aux, BContensDat::New("variance",variance, "")); 2537 LstFastAppend(result, aux, BContensPol::New("phi",phiB, "")); 2538 LstFastAppend(result, aux, BContensPol::New("theta",thetaB, "")); 2559 BGrammar::IncLevel(); 2560 BContensDat* variance_ = BContensDat::New("",variance, ""); 2561 BContensPol* phiB_ = BContensPol::New("",phiB, ""); 2562 BContensPol* thetaB_ = BContensPol::New("",thetaB, ""); 2563 variance_->PutName("variance"); 2564 phiB_->PutName("phi"); 2565 thetaB_->PutName("theta"); 2566 LstFastAppend(result, aux, variance_); 2567 LstFastAppend(result, aux, phiB_); 2568 LstFastAppend(result, aux, thetaB_); 2539 2569 contens_.RobElement(result); 2570 BGrammar::DecLevel(); 2540 2571 } 2541 2572
Note: See TracChangeset
for help on using the changeset viewer.
