I should have added that:

I have done searching and experimentation...

I am not sure the VARselect is the right one to use here...

i.e. is it a good way to do Johansen cointegration test in the following 3
lines?

I am not very sure...

Thank you!


bb=VARselect(cbind(y1, y2, y3, y4), lag.max=10)
K= bb$selection["SC(n)"]

myjo=ca.jo(cbind(y1, y2, y3, y4), K=K)



On Mon, Apr 2, 2012 at 5:12 PM, Michael <comtech.usa@gmail.com> wrote:

> Hi all,
>
> I am using the "ca.jo" function. Is there a way to select the "optimal" K
> automatically and programmatically?
>
> Thanks a lot!
>
> ------------------------------------
>
> ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"),
> K = 2,
> spec=c("longrun", "transitory"), season = NULL, dumvar = NULL)
>

	[[alternative HTML version deleted]]

