similar to: citation question

Displaying 20 results from an estimated 9000 matches similar to: "citation question"

2012 Jul 30
1
confusion over S3/S4 importing
Can anyone help me figure out the right way to import a method that is defined as S3 in one package and S4 in another? Specifically: profile() is defined as an S3 method in the stats package: function (fitted, ...) UseMethod("profile") <bytecode: 0xa4cd6e8> <environment: namespace:stats> In stats4 it is defined as an S4 method: stats4:::profile standardGeneric for
2009 Aug 10
1
model.matrix evaluation challenges
I am having difficulty with evaluation/environment construction for a formula to be evaluated by model.matrix(). Basically, I want to construct a model matrix that first looks in "newdata" for the values of the model parameters, then in "object at data". Here's what I've tried: 1. model.matrix(~f,data=c(newdata,object at data)) -- fails because something (terms()?)
2009 Nov 04
1
compute maximum likelihood estimator for a multinomial function
Hi there I am trying to learn how to compute mle in R for a multinomial negative log likelihood function. I am using for this the book by B. Bolker "Ecological models and data in R", chapter 6: "Likelihood an all that". But he has no example for multinomial functions. What I did is the following: I first defined a function for the negative log likelihood:
2004 May 07
1
mle
I'm very excited by the new mle package now incorporated in stats4. If possible, I'd like to help develop it. In the past I wrote a similar package (mleprof, available from http://www.zoo.ufl.edu/bolker/R/src), and would like to see if there's anything that my package does that I could contribute (in particular, I'd like to make sure that the code is as robust as possible in
2005 Jan 10
1
mle() and with()
I'm trying to figure out the best way of fitting the same negative log-likelihood function to more than one set of data, using mle() from the stats4 package. Here's what I would have thought would work: -------------- library(stats4) ## simulate values r = rnorm(1000,mean=2) ## very basic neg. log likelihood function mll <- function(mu,logsigma) {
2011 Feb 11
2
fitdistr question
Hello, I tried to fit a poisson distribution but looking at the function fitdistr() it does not optimize lambda but simply estimates the mean of the data and returns it as lambda. I'm a bit confused because I was expecting an optimization of this parameter to gain a good fit... If I would use mle() of stats4 package or mle2() of bbmle package, I would have to write the function by myself
2006 Jan 19
1
nls profiling with algorithm="port" may violate bounds (PR#8508)
[posted to R-devel, no discussion: resubmitting it as a bug, just so it gets logged appropriately] Sorry to report further difficulties with nls and profiling and constraints ... the problem this time (which I didn't check for in my last round of testing) is that the nls profiler doesn't seem to respect constraints that have been set when using the port algorithm. See test code
2008 Nov 19
1
mle2 simple question - sigma?
I'm trying to get started with maximum likelihood estimation with a simple regression equivalent out of Bolker (Ecological Models and Data in R, p302). With this code: #Basic example regression library(bbmle) RegData<-data.frame(c(0.3,0.9,0.6),c(1.7,1.1,1.5)) names(RegData)<-c("x", "y") linregfun = function(a,b,sigma) { Y.pred = a+b*x
2010 Jul 31
2
Is profile.mle flexible enough?
Hi the list, I am experiencing several issues with profile.mle (and consequently with confint.mle) (stat4 version 2.9.2), and I have to spend a lot of time to find workarounds to what looks like interface bugs. I would be glad to get feedback from experienced users to know if I am really asking too much or if there is room for improvement. * Problem #1 with fixed parameters. I can't
2012 Nov 25
5
bbmle "Warning: optimization did not converge"
I am using the Ben bolker's R package "bbmle" to estimate the parameters of a binomial mixture distribution via Maximum Likelihood Method. For some data sets, I got the following warning messages: *Warning: optimization did not converge (code 1: ) There were 50 or more warnings (use warnings() to see the first 50)* Also, warnings() results the following: *In 0:(n - x) : numerical
2006 Oct 31
0
help with extended mle package?
A while back, I wrote to the list/engaged in some debate with Peter Dalgaard about the mle() function in the stats4 package -- in particular, I wanted it to have a data= argument so that parameters could be estimated for different sets of data with the same minuslogl function: Peter disagreed, suggesting that a function-defining-function (e.g. something like minusloglfun <- function(data) {
2012 Mar 29
3
r-forge build failure bafflement
I am attempting to build a package on r-forge and running into a weird error. I have been in correspondence with the R-forge admins and am turning to r-devel on the remote chance that someone might have a guess as to what is going wrong or a suggestion about further diagnostics/experiments I could try ... The package seems to build fine on my system(s) with R CMD build --compact-vignettes
2007 Dec 10
2
another S4 question ...
The default generic method for "show" has arguments show(object) -- (no "...") -- which precludes any kind of arguments like "digits", etc. Is it impossible, or a horrible idea, to override the generic definition? (The "arm" package has defined a new generic, "display", which does a similar thing but has an intermediate level of detail
2009 Feb 01
2
Extracting Coefficients and Such from mle2 Output
The mle2 function (bbmle library) gives an example something like the following in its help page. How do I access the coefficients, standard errors, etc in the summary of "a"? > x <- 0:10 > y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8) > LL <- function(ymax=15, xhalf=6) + -sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE)) > a <- mle2(LL,
2012 Nov 08
2
Comparing nonlinear, non-nested models
Dear R users, Could somebody please help me to find a way of comparing nonlinear, non-nested models in R, where the number of parameters is not necessarily different? Here is a sample (growth rates, y, as a function of internal substrate concentration, x): x <- c(0.52, 1.21, 1.45, 1.64, 1.89, 2.14, 2.47, 3.20, 4.47, 5.31, 6.48) y <- c(0.00, 0.35, 0.41, 0.49, 0.58, 0.61, 0.71, 0.83, 0.98,
2008 Jul 25
3
Maximization under constraits
I''m looking for a R function which can maximise this logliklihood function, under the constraits a>0 e b>0 f<-function(param){ a<-param[1] b <-param[2] log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(pi ))*(1-pnorm(-b/(2*sqrt(a)), mean=0, sd=1)))))} I''ve tried maxlik constrOptim e donlp2 but without success. Thanks so
2019 Feb 19
1
mle (stat4) crashing due to singular Hessian in covariance matrix calculation
Hi, R developers. when running mle inside a loop I found a nasty behavior. From time to time, my model had a degenerate minimum and the loop just crashed. I tracked it down to "vcov <- if (length(coef)) solve(oout$hessian)" line, being the hessian singular. Note that the minimum reached was good, it just did not make sense to calculate the covariance matrix as the inverse of a
2008 Apr 04
2
suggested minor patch for optim.R
optim ignores misspelled control parameters, so that trying to set (e.g.) "maxint=1000" in the control argument silently does nothing. The patch below (watch out for line breaks! also posted at http://www.zoo.ufl.edu/bolker/optim_patch.R , and http://www.zoo.ufl.edu/bolker/optim_new.R) adds three lines to optim.R that issue a warning if any names of elements of "control" fail
2009 Nov 03
2
design matrix construction question
with the following simple data frame dd = structure(list(z = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L ), .Label = c("a", "b"), class = "factor"), x = c(0.3, 0.2, 0.1, 0, 0, 0, 0.2, 0.3)), .Names = c("z", "x"), row.names = c(NA, -8L), class = "data.frame") I would like know if it's possible to use model.matrix() to construct the
2009 Aug 17
2
unnecessary braces?
the version 2 parser thinks I have unnecessary braces, but I can't find any. False positive or am I missing something? If a false positive, is there any way to work around the warning? * checking Rd files against version 2 parser ... WARNING Warning: ./man/dbetabinom.Rd:32-34: Unnecessary braces at ?{p(x) = % (C(N,x)*Beta(N-x+theta*(1-p),x+theta*p))/% Beta(theta*(1-p),theta*p)}?