Re: [R] question about order

2008-01-28 Thread Achim Zeileis
On Mon, 28 Jan 2008, Waverley wrote: > I have a data vector as following: > > z > [1] 183.1370 201.9610 113.7250 140.7840 156.2750 42.1569 42.1569 42.1569 > [9] 240.1960 308.4310 42.1569 42.1569 42.1569 42.1569 42.1569 42.1569 > [17] 42.1569 42.1569 42.1569 42.1569 279.8040 42.1569

Re: [R] question about order

2008-01-28 Thread Benilton Carvalho
that seems right order() gives you the indexes "idx" such that x[idx] == sort(x) > set.seed(123) > x <- rnorm(10) > idx <- order(x) > identical(x[idx], sort(x)) [1] TRUE best b On Jan 28, 2008, at 8:19 PM, Waverley wrote: I have a data vector as following: z [1] 183.1370 201.9610 113.72

[R] question about order

2008-01-28 Thread Waverley
I have a data vector as following: > z [1] 183.1370 201.9610 113.7250 140.7840 156.2750 42.1569 42.1569 42.1569 [9] 240.1960 308.4310 42.1569 42.1569 42.1569 42.1569 42.1569 42.1569 [17] 42.1569 42.1569 42.1569 42.1569 279.8040 42.1569 42.1569 when I sort, it gave me the right ord

[R] question about order selection of ar

2008-01-14 Thread tom soyer
Hi, I have an AR(1) series, so I thought that the order of the series should be 1. A simple lm fit with one period lag predicts the series pretty well. But when I tried ar, I got different orders: ar.mle selected order 6, ar.burgselected order 14, and ar.yw selected order 6. So I am wondering mayb