[R] ca.jo function, urca package, singular matrix problem

John C Frain frainj at gmail.com
Thu Jul 9 21:23:47 CEST 2015


There is something very wrong in your data set. You appear to have two
distinct observations of your variables and these are continuously repeated
throughout the sample.
On 9 Jul 2015 18:26, "Bert Gunter" <bgunter.4567 at gmail.com> wrote:

> I do know nothing about what you are specifically doing (!!) but...
>
> In general, R uses factors and contrasts not dummy variables to handle
> categorical variables in (linear) models, so it might be that your
> dummy variable representation is what causes the singularity. If so,
> do a web search on "contrasts in R" for background and details. Also
> ?contrasts and the linked man pages in R.
>
> Cheers,
> Bert
>
>
> Bert Gunter
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
>    -- Clifford Stoll
>
>
> On Thu, Jul 9, 2015 at 6:51 AM, mrrox <r.otojanov at qmul.ac.uk> wrote:
> > Hi, I am trying to run a cointegration test with a dummy variable using
> > `*ca.jo*` function in `*urca*` package.
> >
> > *johcoint=ca.jo
> (Ydata[10:60,1:5],type="trace",ecdet=c("const"),K=2,spec="transitory",dumvar=dumvar)
> > *
> >  `*dumvar*` is the binary variable that take 1 and 0 only. the first two
> > observations are 1 and the rest are 0s.
> > when I run the code, I get
> >
> >    / Error in solve.default(M11) :
> >           Lapack routine dgesv: system is exactly singular: U[1,1] = 0/
> >
> > I think this is something to do with the invertability of the input
> matrix,
> > and this occurs only when I use `*dumvar*` only. The error message
> > disappears if I add a 1 to the 3rd observation of `dumvar`.
> >
> > Below is the sample data just for info:
> >
> >
> >               A             B            C             D             E
> > dumvar
> >     1  2.255446 1.688807 1.506579 1.880152 9.575868      1
> >     2  2.230118 1.578281 1.546805 1.905426 9.545534      1
> >     3  2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     4  2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     5  2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     6  2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     7  2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     8  2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     9  2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     10 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     11 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     12 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     13 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     14 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     15 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     16 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     17 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     18 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     19 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     20 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     21 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     22 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     23 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     24 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     25 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     26 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     27 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     28 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     29 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     30 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     31 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     32 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     33 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     34 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     35 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     36 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     37 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     38 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     39 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     40 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     41 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     42 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     43 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     44 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     45 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     46 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     47 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     48 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >     49 2.255446 1.688807 1.506579 1.880152 9.575868      0
> >     50 2.230118 1.578281 1.546805 1.905426 9.545534      0
> >
> > Thank you!
> >
> >
> >
> > --
> > View this message in context:
> http://r.789695.n4.nabble.com/ca-jo-function-urca-package-singular-matrix-problem-tp4709635.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list