set echo off set messages off function wait clear function wait(scalar time, series serie) series serie = ok(serie)*serie loop j=1..time --quiet outfile --write "C:\Archivos de programa\gretl\tramo\tmp" arima 0 0 2; serie outfile --close endloop end function wait function tramolin clear function tramolin(list xlist, scalar year, scalar startp) ! cmd /c "del /Q tmp_descript" list retlist = null scalar nobser = $nobs loop foreach i xlist --quiet series $i2=ok($i)*($i)+missing($i)*(-99999) outfile --write "C:\Archivos de programa\gretl\tramo\$i" printf "%s\n", "$i" printf "%.8g %.8g %.8g %.8g\n", nobser, year, startp, $pd loop j=1..nobser --quiet scalar jj=j scalar dato = $i2[jj] printf "%.8g\n", dato endloop printf "$INPUT RSA=3 $\n" printf "\n" outfile --close #delete $i2 ! cmd /c "cd tramo\graph\series && del /Q *.t" ! cmd /c "cd tramo && tramo -i $i -k $i.ser " wait(5, $i) #! cmd /c "cd tramo\graph\series && echo $i_adj > $i.txt" ! cmd /c "cd tramo\graph\series && if exist xlin.t. (echo $i_lin > $i.txt) else (echo $i_orig > $i.txt)" wait(5, $i) ! cmd /c "cd tramo\graph\series && if exist xlin.t. (more +6 xlin.t >> $i.txt) else (more +6 xorigt.t >> $i.txt)" wait(2, $i) append ".\tramo\graph\series\$i.txt" #wait(5, $i) if ok(isseries($i_lin))=0 list retlist = retlist $i_orig rename $i_orig $i_adj setinfo $i_adj -d "Original" else list retlist = retlist $i_lin rename $i_lin $i_adj setinfo $i_adj -d "Linearized" endif endloop #run tmp_descript #! cmd /c "del /Q tmp_descript" return list retlist end function