Em 25 de abril de 2012, Allin escreveu:
On Thu, 26 Apr 2012, Riccardo (Jack) Lucchetti wrote:
> on Wed, 25 Apr 2012, Henrique Andrade wrote:
>
>> matrix teste_t = $coeff./$stderr
>> matrix roots = $["roots"]
>> if abs(teste_t)>critical(t, $T, 0.025) &&
abs(roots[,1])>1
>
> What do you want to do here, exactly? "teste_t" is a matrix, so its
absolute
> value is a matrix too. How can you base an "if" condition on a
> multiple-valued object?
You can actually do that, but (as I think Jack is implying) you have
to be careful what you intend. In this case the "if" condition will
evaluate as true if and only if _every_ element of the matrix
teste_t exceeds the two-sided 5% critical value of the student t
distribution -- that is, iff every arima coefficient is
"significant". (...)
Dear Jack and Allin,
Sorry if I wasn't clear enough on my messages. Blame on my poor English ;-)
Let me try to explain what is the main goal of the AutoARIMA function:
1. The user selects a time series;
2. Determines the max number os AR(p) and MA(q) terms;
3. The AutoARIMA function will estimate all the possible combinations of
ARIMA(p,1,q),
4. Every time the estimated model exhibits its roots outside the unit
circle and all its
coefficients have statistical significance, AutoARIMA will save the
predictions of that model.
Answering the other question that Allin did...
Em 25 de março de 32012, Allin escreveu:
On Wed, 25 Apr 2012, Henrique Andrade wrote:
> So I need to make some modifications in my Hansl code. Please look at
this
> small code:
>
> <hansl>
> function list testarima (series y, int p[1:12:2], int q[1:12:2])
> list Forecasts = null
> loop P=1..p
> loop Q=1..q
> arima P 1 Q ; y --nc --quiet
> series dummy_mais = misszero(($uhat >= +2*sd($uhat)))
> series dummy_menos = misszero(($uhat <= -2*sd($uhat)))
> arima P 1 Q ; y dummy_mais dummy_menos --nc --quiet
> matrix teste_t = $coeff./$stderr
> matrix roots = $["roots"]
> if abs(teste_t)>critical(t, $T, 0.025) && abs(roots[,1])>1
> arima P 1 Q ; y --nc
> fcast Y_hat_$P_1_$Q
> list Forecasts += Y_hat_$P_1_$Q
> print Forecasts --byobs
> endif
> endloop
> endloop
> return Forecasts
> end function
>
> open fedstl.bin
> data exbzus exchus
> dataset addobs 12
> list Lista = testarima(exchus)
> print Lista --byobs
> </hansl>
>
> The problem now is that my function only prints the forecasts but doesn't
> store them appropriately inside the list "Projecoes".
Are you sure? If I run the script exactly as copied from above, the
final command, "print Lista --byobs", prints three series returned
in Lista by your function, namely Y_hat_1_1_1, Y_hat_1_1_2 and
Y_hat_2_1_1. (I don't know anything about "Projecoes" since that
does not appear anywhere in the script.)
Sorry again if I wasn't clear enough :-( I was talking about the attached
function (and
not the one in the body of the e-mail message). To avoid more mistakes I'm
attaching
it again.
Kind regards,
Henrique Andrade*
*