Giter Site home page Giter Site logo

glmmsr's People

Contributors

heogden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

glmmsr's Issues

adding attribute on a symbol

From Tomas Kalibera:

I am working on various parts in the core R and I found a problem in glmmsr - it is adding attributes on symbols. The code is in modify_subexpr.R, in add_sub_status:

add_sub_status <- function(x, subvar) {
if(is.atomic(x)){
attr(x, "sub") <- FALSE
x
} else if(is.name(x)) {
if(identical(as.character(x), subvar)) {
attr(x, "sub") <- TRUE # <================== here
} else {
attr(x, "sub") <- FALSE # <================== here
}
x

Adding an attribute to a symbol is very dangerous, because it has a global effect. Unlike adding it e.g. to a vector or a language object, which is fine, because these objects are copied automatically when modified. When you add an attribute to a symbol, you modify all symbols in the R session, because symbols are passed by reference, so if for example you modified a commonly used symbol like "x", all variables in the program named "x" would be impacted. We will have to turn this into a runtime error, but before we do so I am indeed letting package maintainers know. I hope in your case the fix should be simple, I think you could wrap symbol x into a "list" (or "expression" or other object) and add the attribute to that list, inside add_sub_status, yet perhaps you would have to slightly adapt the code that traverses expressions.

problems when compiled with clang

Sometimes when compiled with clang, causes segfault when method = "SR" is used.

For example:

library(glmmsr)
(mod_SR <- glmm(response ~ covariate + (1 | cluster) + (1 | group),
               data = three_level, family = binomial, method = "SR",
               control = list(nSL = 3)))

may cause a segfault.

This is caused by removeNode, when initializing the ClusterGraph. In underlying boost graph, trying to remove an edge which doesn't exist.

Handling `family = gaussian`?

On:

devtools::session_info()
##Session info -------------------------------------------------------------------
## setting  value                       
## version  R version 3.2.4 (2016-03-10)
## system   x86_64, linux-gnu           
## ui       X11                         
## language en_US                       
## collate  en_US.UTF-8                 
## tz       <NA>                        
## date     2016-03-14                  
##
##Packages -----------------------------------------------------------------------
## package  * version date       source                         
## devtools   1.10.0  2016-01-23 CRAN (R 3.2.3)                 
## digest     0.6.9   2016-01-08 CRAN (R 3.2.3)                 
## glmmsr   * 0.1.1   2016-03-14 Github (heogden/glmmsr@bb79178)
## memoise    1.0.0   2016-01-29 CRAN (R 3.2.3)                 
## R6         2.1.2   2016-01-26 CRAN (R 3.2.3)                 
## Rcpp       0.12.3  2016-01-10 CRAN (R 3.2.3)  

with the CRAN or the most recent github version.

library(glmmsr)
data(sleepstudy, package = 'lme4')
glmm(Reaction ~ (1|Subject), data = sleepstudy, family = gaussian, method = 'Laplace')

## *** caught segfault ***
##address 0x5d1, cause 'memory not mapped'
##
##Traceback:
## 1: .Call(glmerLaplace, rho$pp$ptr(), rho$resp$ptr(), nAGQinit, control$tolPwrss,     maxit, verbose)
## 2: lme4::mkGlmerDevfun(fr = modfr$fr, X = modfr$X, reTrms = modfr$reTrms,     family = modfr$family, control = lme4_control())
## 3: find_lfun_glmm_internal(modfr, method = method, control = con)
## 4: glmm(Reaction ~ Days + (1 | Subject), data = sleepstudy, family = gaussian,     method = "Laplace")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.