search for: mustart

Displaying 20 results from an estimated 40 matches for "mustart".

Did you mean: mstart
2006 Apr 11
1
gaussian family change suggestion
...d using `gaussian("log")', this seems a bit unsatisfactory. Might it be worth changing it? The current offending code from `gaussian' is: initialize = expression({ n <- rep.int(1, nobs) if (is.null(etastart) && is.null(start) && is.null(mustart) && ((family$link == "inverse" && any(y == 0)) || (family$link == "log" && any(y <= 0)))) stop( "cannot find valid starting values: please specify some") mustart <- y })...
2010 Jul 22
1
GLM Starting Values
Hello, Suppose one is interested in fitting a GLM with a log link to binomial data. How does R choose starting values for the estimation procedure? Assuming I don't supply them. Thanks, Tyler
2006 Jan 14
2
initialize expression in 'quasi' (PR#8486)
This is not so much a bug as an infelicity in the code that can easily be fixed. The initialize expression in the quasi family function is, (uniformly for all links and all variance functions): initialize <- expression({ n <- rep.int(1, nobs) mustart <- y + 0.1 * (y == 0) }) This is inappropriate (and often fails) for variance function "mu(1-mu)". Here is a short demo to show it: ################################################# set.seed(666) dat <- data.frame(x = rep((-10):10, each = 5), w = rep(1:5, 21)) dat <- trans...
2005 Nov 28
3
glm: quasi models with logit link function and binary data
# Hello R Users, # # I would like to fit a glm model with quasi family and # logistical link function, but this does not seam to work # with binary data. # # Please don't suggest to use the quasibinomial family. This # works out, but when applied to the true data, the # variance function does not seams to be # appropriate. # # I couldn't see in the # theory why this does not work. # Is
2006 Nov 12
2
segfault 'memory not mapped', dual core problem?
...m (obtained from CRAN). (My processor is an AMD Athlon 64 x2 4800+). The error and traceback are *** caught segfault *** address 0x8001326f2b, cause 'memory not mapped' Traceback: 1: any(is.na(varmu)) 2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, "intercept") > 0) 3: glm(y ~ x, family = binomial("logit"), data = da) 4: ... Note that this does NOT happen every time I make this call to glm(). I'm calling glm() in a loop an...
2002 Apr 15
1
glm link = logit, passing arguments
...link=logit), trace = TRUE) Deviance = 28.34255 Iterations - 1 Deviance = 27.72554 Iterations - 2 Deviance = 27.72527 Iterations - 3 Warning message: non-integer #successes in a binomial glm! in: eval(expr, envir, enclos). But trying to exclude intercept (or pass anything to glm.fit, especially mustart to improve convergence if I have understand the role of mustart correctly): glm(as.matrix(y) ~ as.matrix(X), family=binomial(link=logit), intercept = FALSE, TRACE = TRUE) seems not to be a correct since it returns: Error in glm.control(...) : unused argument(s) (intercept ...) ### Same apply to...
2009 Mar 27
1
deleting/removing previous warning message in loop
Hello R Users, I am having difficulty deleting the last warning message in a loop so that the only warning that is produced is that from the most recent line of code. I have tried options(warn=1), rm(last.warning), and resetting the last.warning using something like: > warning("Resetting warning message") This problem has been addressed in a previous listserve string,
2009 Dec 17
2
segfault in glm.fit (PR#14154)
...~ x, family=poisson, data=df) ------ output --------------- *** caught segfault *** address (nil), cause 'unknown' Traceback: 1: ifelse(y == 0, 1, y/mu) 2: dev.resids(y, mu, weights) 3: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, "intercept") > 0) 4: glm(y ~ x, family = poisson, data = df) -------------------------------- The code generates a segfault if the value of 'N' is greater than 16384. regards Adrian Ba...
2002 Feb 27
1
Bug in glm.fit? (PR#1331)
...at's all for now. Thanks for the great package and I hope that this bug report will be useful. Cheers, Berwin ========================= original glm.fit ========================= 1 glm.fit <- 2 function (x, y, weights = rep(1, nobs), start = NULL, etastart = NULL, 3 mustart = NULL, offset = rep(0, nobs), family = gaussian(), 4 control = glm.control(), intercept = TRUE) 5 { 6 x <- as.matrix(x) 7 xnames <- dimnames(x)[[2]] 8 ynames <- names(y) 9 conv <- FALSE 10 nobs <- NROW(y) 11 nvars <- NCOL(x) 12...
2003 Jan 21
1
Starting values for glm fits
I'm fitting some small data sets using a binomial glm with complementary log-log link. In some ill-conditioned cases I am getting convergence failures. I know how to adjust maxit and epsilon, but that doesn't seem to help. In fact I know some very good starting values for my fits, but I can't see how to get them in to glm(). How may I do this? -- Dr Murray Jorgensen
2008 Oct 19
1
MCMClogit: using weights
...with MCMClogit function (in MCMCpack package). For example, in case of glm function as given below, there is weights option in the arguments. Aparently there is no option of using weights in MCMClogit. glm(formula, family = gaussian, data, weights, subset, na.action, start = NULL, etastart, mustart, offset, control = glm.control(...), model = TRUE, method = "glm.fit", x = FALSE, y = TRUE, contrasts = NULL, ...) MCMClogit(formula, data = parent.frame(), burnin = 1000, mcmc = 10000, thin=1, tune=1.1, verbose = 0, seed = NA, beta.start = NA, b0 = 0, B0 = 0, user.prior....
2012 Jun 20
0
formula method with "special" characters
...ently I'm missing something here...any help is much appreciated. Thanks, Leo. "gam2.slist" <- c("s", "lo", "random") "gam2" <- function(formula, family = gaussian, data, weights, subset, na.action, start = NULL, etastart, mustart, control = gam.control(...), model = FALSE, method="glm.fit", x = FALSE, y = TRUE, ...) { call <- match.call() mf <- match.call(expand.dots = FALSE) m <- match(c("formula", "data", "subset", "weights", "na.action"...
2012 Aug 15
3
Basic question -loading data
Hi all, New user here - I include the following command in the prompt read.csv("document.csv", header = TRUE ) and the output shows up. But when I include the following command summary(data) I get the following message "Error in object[[i]] : object of type 'closure' is not subsettable" Can someone please advise why R is not reading my data? Thanks
2012 Mar 02
1
Vector errors and missing values
Hi, I am trying to run two Non-Gaussian regressions: logistic and probit. I am receiving two different errors when I try to run these regressions and I am not sure what they mean or how to fix my syntax. Here is the logistic regression error: Error in family$linkfun(mustart) : Argument mu must be a nonempty numeric vector Here is the probit regression error: Error in pmax(eta, -thresh) : cannot mix 0-length vectors with others The dataset that I am using has some missing data. R puts NA values in place of the missing values. I am not sure if this is what is caus...
2018 Aug 03
0
glm Argument-Evaluation Does Not Match Documentation.
Details in documentation: "All of ?weights?, ?subset?, ?offset?, ?etastart? and ?mustart? are evaluated in the same way as variables in ?formula?, that is first in ?data? and then in the environment of ?formula?." In fact, `data` is usually not an environment, and I have not seen arguments evaluated in `environment(formula)` when `data` is provided. (Information in `environment(fo...
2007 Feb 10
2
error using user-defined link function with mixed models (LMER)
...y), round(m), mu, log = TRUE)) } initialize <- expression({ if (NCOL(y) == 1) { if (is.factor(y)) y <- y != levels(y)[1] n <- rep.int(1, nobs) if (any(y < 0 | y > 1)) stop("y values must be 0 <= y <= 1") mustart <- (weights * y + 0.5)/(weights + 1) m <- weights * y if (any(abs(m - round(m)) > 0.001)) warning("non-integer successes in a binomial glm!") } else if (NCOL(y) == 2) { if (any(abs(y - round(y)) > 0.001))...
2019 Apr 26
1
Error in glm(..., family=quasi(..., variance=list(...)))
...I have not seen discussed previously: x <- runif(1000, min=0, max=1) y <- x + rnorm(1000, mean=0, sd=1)*x^(3/4) vf <- function(mu) { abs(mu)^(3/4) } vm <- function(mu) { rep(TRUE, length(mu)) } dr <- function(y, mu, wt) { (y-mu)^2 } it <- expression({ n <- rep.int(1, nobs); mustart <- y }) glm(y ~ x, family=quasi(link="identity", variance=list(varfun=vf, validmu=vm, dev.resids=dr, initialize=it, name="custom"))) This gives "Error in switch(vtemp, constant = { : EXPR must be a length 1 vector" from line 576 in file family.R (https://github.com...
2012 May 10
0
disagreement in loglikelihood and deviace in GLM with weights leads to different models selected using step()
...with 75 presence and 75 absence if instead I had randomly sampled 3150 background points I could set the weights to 1 for presence and 75/3150 for the background points. I simulate this example by repeating my 75 absences 42 times and setting the weights for the absence to 75/3150 and setting mustart equal to the predicted response from the 75/75 model and fitting glms to each data set. The output agrees in the coefficient estimates null and residual deviance but NOT in the AIC or the value returned from logLik() it appears the AIC is calculated from the likelihood though as I understand i...
2005 Jun 14
1
New Family object for GLM models...
...2 * sum(ifelse(m > 0, (wt/m), 0) * dbinom(round(m * y), round(m), mu, log = TRUE)) } initialize<- expression({ n<-rep(1,nobs) if (any(y < 0 | y > 1)) stop("y values must be 0 <= y <= 1") mustart <- (weights * y + 0.5)/(weights + 1) m <- weights * y if (any(abs(m - round(m)) > 0.001)) warning("non-integer #successes in a binomial glm!") }) environment(variance) <- environment(validmu) <- environment(dev.resids) <- envi...
2005 Jun 16
1
mu^2(1-mu)^2 variance function for GLM
..." is invalid: possible values are \"mu(1-mu)\", \"mu^2(1-mu)^2\", \"mu\", \"mu^2\", \"mu^3\" and \"constant\"", variancetemp), domain = NA)) initialize <- expression({ n <- rep.int(1, nobs) mustart <- y + 0.1 * (y == 0) }) aic <- function(y, n, mu, wt, dev) NA structure(list(family = "quasi", link = linktemp, linkfun = stats$linkfun, linkinv = stats$linkinv, variance = variance, dev.resids = dev.resids, aic = aic, mu.eta = stats$mu.eta, initi...