Re: [R] non-conformable arrays

2024-09-12 Thread Thierry Onkelinx
Dear Peter, That was indeed this issue. Thanks for the feedback. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biome

Re: [R] non-conformable arrays

2024-09-11 Thread Ivan Krylov via R-help
В Wed, 11 Sep 2024 17:55:53 +0200 Thierry Onkelinx пишет: > For those how like a fully reproducible example: > the offending line in the code: > https://github.com/inbo/multimput/blob/e1cd0cdff7d2868e4101c411f7508301c7be7482/R/impute_glmermod.R#L65 > a (failing) unit test for the code: > https://

Re: [R] non-conformable arrays

2024-09-11 Thread peter dalgaard
Hum... Two points: You are using |> a lot and tcrossprod() is a primitive, so ignores argnames. This makes me suspicious that things like ... ) |> tcrossprod(x = mm) might not do what you think it does. E.g., > a <- matrix(1,10,2) > b <- matrix(1,3,2) > tcrossprod(y=b, x=a) [,1] [,2] [

[R] non-conformable arrays

2024-09-11 Thread Thierry Onkelinx
Dear all, I'm puzzled by this error. When running tcrossprod() within the function it returns the error message. The code also outputs the object a and b. Running the tcrossprod() outside of the function works as expected. cat("a <-") dput(a) cat("b <-") dput(b)

[R] Non-conformable arrays - Error in var(betas)

2015-11-19 Thread Naomi Evans
Hello, If there is anyone who can offer me some guidance on how to resolve the error below, I would be very grateful. I am attempting to conduct a 'Resource Utilization Function' analysis using the 'ruf' package. My code is below: library(ruf) d78423 <- read.csv("RUF/78423_RelUse.csv") #

Re: [R] non-conformable arrays

2013-07-24 Thread Thomas Stewart
You need to be careful how you index. In the example code, y is a 'zoo series' and y[i] is gives the ith row, as in y[i, ]. This means t(y[i]) %*% y[i] is actually a 2X2 matrix. Also, the code c(S)[c(1,4,2)] picks off the diagonal and lower triangular elements. The example involves two stocks,

[R] non-conformable arrays

2013-07-23 Thread G Girija
Hi, I have 5 stock values and i am calculating EWMA followed the logic as given ind following link.[ http://www.orecastingfinancialrisk.com/3.html ] [EWMA = matrix(nrow=T,ncol=3) # create a matrix to hold the covariance matrix for each t lambda = 0

Re: [R] Non-conformable arrays

2011-03-02 Thread Gregory Ryslik
wrong levels, turn it > back into a character string vector first. > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Gregory Ryslik > Sent: Thursday, 3 March 2011 1:46 PM > To: r-help Help > Subject:

Re: [R] Non-conformable arrays

2011-03-02 Thread Bill.Venables
-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gregory Ryslik Sent: Thursday, 3 March 2011 1:46 PM To: r-help Help Subject: [R] Non-conformable arrays Hi Everyone, I'm running some simulations where eventually I need to table the results. The problem is, that while

[R] Non-conformable arrays

2011-03-02 Thread Gregory Ryslik
Hi Everyone, I'm running some simulations where eventually I need to table the results. The problem is, that while most simulations I have at least one predicted outcome for each of the six possible categories, sometimes the algorithm assigns all the outcomes and one category is left out. Thus