Yuanyuan Tang
2012-Jan-24 01:30 UTC
[R] Cannot evaluate subset expression for sigmainverse
Hi, anybody can help me with this? can JAGS solve the inverse of a matrix in the 3-way array? Thank you! for(i in 1:n){ for(a in 1:t[i]){ for(b in 1:t[i]){ sigma[i,a,b]<-pow(rho,t[a]-t[b]) } } sigmainverse[i,,]<-inverse(sigma[i,,]) # this is where jags got error } [[alternative HTML version deleted]]
R. Michael Weylandt
2012-Jan-24 02:19 UTC
[R] Cannot evaluate subset expression for sigmainverse
There are multiple inverse() functions in the R universe: which one are you attempting to use? (Also, none of them seem to be in particularly standard packages: are you sure you aren't looking for solve()?) Reproducible code (as well as including the error you got) would be very helpful. Michael On Mon, Jan 23, 2012 at 8:30 PM, Yuanyuan Tang <cicitangyy at gmail.com> wrote:> Hi, anybody can help me with this? can JAGS solve the inverse of a matrix > in the 3-way array? Thank you! > > for(i in 1:n){ > ? ?for(a in 1:t[i]){ > ? ? ?for(b in 1:t[i]){ > ? ? ? ?sigma[i,a,b]<-pow(rho,t[a]-t[b]) > ? ? ?} > ? ?} > ? ?sigmainverse[i,,]<-inverse(sigma[i,,]) # this is where jags got error > ?} > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > 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.