similar to: unexpected behaviour with sparse.model.matrix

Displaying 20 results from an estimated 10000 matches similar to: "unexpected behaviour with sparse.model.matrix"

2009 Sep 28
1
model.matrix troubles with AlgDesign
Dear DevelopeRs, in continuing with my suite of packages on experimental design, I am stuck with an issue that appears to be related to package AlgDesign - I have tried to get it solved by Bob Wheeler, but he seems to be stuck as well. Whenever AlgDesign is loaded, some of my code does not work any more. For example, in a fresh R session: require(DoE.base) fac.design(nlevels=c(2,6,2))
2003 Jul 22
2
animal models and lme
Hi, You should look at Pinheiro and Bates (2000) Mixed-effects models in S and S-Plus. It describes how to format the correlation matrix to pass to functions lme and gls. Basically, the correlation matrix has to be one of the corStruct classes, probably corSymm for your example. So in the call to lme (or gls if you really have no random effects), use something like:
2004 Jan 30
0
Two apparent bugs in aov(y~ *** -1 + Error(***)), with suggested (PR#6510)
I think there are two bugs in aov() that shows up when the right hand side of `formula' contains both `-1' and an Error() term, e.g., aov(y ~ a + b - 1 + Error(c), ...). Without `-1' or `Error()' there is no problem. I've included and example, and the source of aov() with suggested fixes below. The first bug (labeled BUG 1 below) creates an extra, empty stratum inside
2004 Feb 02
0
Two apparent bugs in aov(y~ *** -1 + Error(***)), with (PR#6520)
I believe you are right, but can you please explain why anyone would want to fit this model? It differs only in the coding from aov(y ~ a + b + Error(c), data=test.df) and merely lumps together the top two strata. There is a much simpler fix: in the line if(intercept) nmstrata <- c("(Intercept)", nmstrata) remove the condition (and drop the empty stratum later if you
2007 Dec 03
1
linking C/C++ external libraries.
Hi Everyone, I'm trying to load some C++ code using dyn.load but I'm getting unresolved symbols associated with some external libraries (CSparse). I gather this is something to do with linking as the the code compiles fine. However, I've passed -L/home/jarrod/My_Programs/SuiteSparse/CSparse/Lib -lcsparse to the complier (g++), either directly using R CMD SHLIB or as
2003 Dec 18
3
mclust - clustering by spatial patterns
Dear All, I have spatial data (presence/absence for 4000 squares) on 250 bird species and would like to use a model-based clustering technique to test for species associations. Is there any way of passing a distance/correlation matrix to mclust as with hclust, rather than the actual data? Or alternatively, is there a way of getting mclust to handle binary data? I'd appreciate any
2004 Feb 05
0
correction to the previously asked question (about mergin g factors)
First of all, I do not understand why conversion to characters are not allowed. That's what Sundar's solution is doing implicitly (but more elegantly). Here's a test of all three. See the function definitions below. > f1 <- factor(sample(letters[1:3], 1e4, replace=TRUE)) > f2 <- factor(sample(letters[3:5], 1e4, replace=TRUE)) > f3 <- factor(sample(letters[5:7],
2007 Aug 08
1
converting character string to an expression
Hi Everyone, I would simply like to coerce a character string into an expression: something like: as.expression(paste(letters[1:3], collapse="+")) but I can't seem to get rid of the quotes. The only way I can get it to work is using as.formula: as.expression(as.formula(paste("~", paste(letters[1:3], collapse="+")))) but this requires the expression to
2008 Dec 28
1
model.matrix and missing values
Hi, Does anyone know an easy way of retaining rows in a model.matrix where missing values are present in the predictors. Ideally I'd be able to retain these rows as zeros. Thanks, Jarrod -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
2006 Feb 08
1
nested random effects in glmm.admb
Hello all, In a previous posting regarding glmm.admb it is stated that glmm.admb can handle 2 nested random effects. I can only fit a single random term at the moment, and wondered if anyone could provide me with some information on how to specify a model with 2 (nested or cross-classified) random terms? Thanks, Jarrod.
2013 Feb 09
1
Swaeve, Beamer and \alt
Hi, I am having trouble getting \alt (or \altenv) to work with Schunk/Sinput and was wondering if anybody had had success? With the slide \begin{frame}[fragile]\frametitle{Basic R} \alt<2>{ <<echo=TRUE>>= 2+2 @ }{ <<echo=TRUE, eval=FALSE>>= 2+2 @ } \end{frame} I get the error message: ! FancyVerb Error: Extraneous input `> 2+2 \end {Sinput} \end
2014 Mar 17
1
valgrind and C++
Hi, I am sorry if this is perceived as a C++ question rather than an R question. After uploading an R library to CRAN (MCMCglmm) the C++ code failed to pass the memory checks. The errors come in pairs like: Mismatched free() / delete / delete [] at 0x4A077E6: free (vg_replace_malloc.c:446) by 0x144FA28E: MCMCglmm (MCMCglmm.cc:2184) Address 0x129850c0 is 0 bytes inside a block of size 4
2003 Dec 01
1
matrix bending
Dear All, I was wondering whether any one knows of a matrix bending function in R that can turn non-positive definite matrices into the nearest positive definite matrix. I was hoping there would be something akin to John Henshall's flbend program (http://agbu.une.edu.au/~kmeyer/pdmatrix.html), which allows the standard errors of the estimated matrix elements to be considered in the
2007 Jan 03
1
problem with logLik and offsets
Hi, I'm trying to compare models, one of which has all parameters fixed using offsets. The log-likelihoods seem reasonble in all cases except the model in which there are no free parameters (model3 in the toy example below). Any help would be appreciated. Cheers, Jarrod x<-rnorm(100) y<-rnorm(100, 1+x) model1<-lm(y~x) logLik(model1) sum(dnorm(y, predict(model1),
2009 Feb 20
2
change attributes of all data.frame elements
Hi, I was wondering whether there was an easy way to change the attributes of all elements in a data.frame (rather than looping through elements)? Specifically, I would like to set the "dim" attributes to NULL Thanks for any help, Jarrod -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
2018 Mar 23
0
MCMCglmm multinomial model results
> On Mar 22, 2018, at 1:31 PM, Michelle Kline <michelle.ann.kline at gmail.com> wrote: > > Hi, > > Thanks in advance for any help on this question. I'm running multinomial > models using the MCMCglmm package. The models have 5 outcome variables > (each with count data), and an additional two random effects built into the > models. The issue is that when I use
2010 Feb 10
0
Sparse file troubles and rsync
Hi. I recently had troubles when I used rsync to do a full copy of one large disk to another. The disks were of the same size, but due to sparse files, and me not passing the "--sparse" switch on my initial try, the files were too big for the destination drive. The whole thing caused me much woe, as the problem was not obvious to me (at first I found some sparse files on the source
2018 Mar 24
1
MCMCglmm multinomial model results
Hi David, Thanks for your comment. I haven't posted the data because they are unpublished and include human subjects so there are issues with sharing on a list serv, but I thought perhaps someone had encountered a similar problem and would already know the answer. I will reconsider whether my University's ethics approval would allow me to post the data and update the question if I think
2000 Jan 13
0
problems with understanding behaviour of glm
Dear R users, I don't understand, what happens in glm in the following example (note that in S-Plus this example finishes with an almost perfect fit, but also 49 warnings): > fit.small <- glm(SKR.ein.aus ~ ., family = binomial, data = daten, maxit=100) Error in (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y, : inner loop 2; can't correct step size In addition:
2011 Jun 16
2
optimization with Sparse matrices
To whom it may concern, I am trying to maximize a log-likelihood function using optim. This is a simple problem with only 18 parameters. To conserve memory, I am using sparse matrices (SLAM) for some of the data matrices used in the computation of the likelihood. However, optim appears to convert the sparse matrix back to regular data format. This causes me to run out of memory as R tries to