search for: bbmle

Displaying 20 results from an estimated 68 matches for "bbmle".

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() resul...
2008 Sep 19
0
panel data analysis possible with mle2 (bbmle)?
Dear R community, I want to estimate coefficients in a (non-linear) system of equations using 'mle2' from the "bbmle" package. Right now the whole data is read in as just one long time series, when it's actually 9 cross sections with 30 observations each. I would like to be able to test and correct for autocorrelation but haven't found a way to do this in this package. On the other hand I have found...
2012 Jul 30
1
confusion over S3/S4 importing
...ode: 0xa4cd6e8> <environment: namespace:stats> In stats4 it is defined as an S4 method: stats4:::profile standardGeneric for "profile" defined from package "stats" function (fitted, ...) standardGeneric("profile") <environment: 0xa59a364> In the bbmle package I want to define it as an S4 method: setMethod("profile", "mle2", function (...) {...}) In the NAMESPACE file for bbmle I have importFrom(stats4,profile) However, in R 2.14.2 (which is I am currently trying to fix: I would like to try to allow for backward com...
2007 May 16
2
citation question
I want to put the correct information into the "author" field of the DESCRIPTION file for my bbmle package, which is a modified and extended version of the mle code in the stats4 package. If I put only myself as author I feel like I'm ignoring the contribution of R-Core (and I think Peter Dalgaard in particular) in writing the original code. If I add "R Development Core Team" t...
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,...
2019 Apr 08
1
debian testing: Problems with R function vignette()
Hola! I am on debian testing, all updates up to date. I am running R via emacs and ess, so I canot know if this is an R or emacs/ess problem. What happens is that I want to read an vignette, and calls something like vignette("mle2", package="bbmle") the pdf file opens (for me in Foxit reader), no problem, but then emacs starts to spew a lot of spam, interfering with the use of ess/R. A small sample: ScheduleTimerQuery called GetDntDataTotal sql exec success GetDntDataQueue sql exec success SchedulePriorTracktype called GetDntDataPrio...
2009 Nov 04
1
compute maximum likelihood estimator for a multinomial function
...7 15 9 3 6 13 11 17 15 36 38 52 49 53 33 20 6 2 1 ########################### I get the error message: "probabilities can't neither be negative nor all 0" So I wanted to try the "mle" or the "mle2" functions of the packages "stats4" and "bbmle" respectively. But I just can't get them running. I tried it like this: ########################### library(bbmle) log.multi<-function(d,p.est){ -sum(dmultinom(x=d,prob=p.est,log=T)) } d<-c(3,5,7) p.est<-d/sum(d) m1<-mle2(minuslogl=log.multi,start=list(p.est=p.est),data=lis...
2011 Feb 11
2
fitdistr question
...tribution 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 which should be optimized. But what shall I return? -sum((y_observed - y_fitted)^2) ? Any other suggestions or comments on my solution? Antje
2008 Aug 18
2
Call a Fortran subroutine with R: R crashes
...mpbvv E:/Zoe/DA/mpbvv.dll Dynamic.Lookup base FALSE methods FALSE grDevices FALSE stats FALSE mpbvv TRUE I am loading four more libraries: library('actuar') library('bbmle') library('polynom') library('NORMT3') Could this be a problem? I don't have any idea why R crashes. Do you? Thanks a lot for your advice in advance! Cheers, Zoe [[alternative HTML version deleted]]
2012 Feb 01
3
Probit regression with limited parameter space
Dear R helpers, I need to estimate a probit model with box constraints placed on several of the model parameters. I have the following two questions: 1) How are the standard errors calclulated in glm (family=binomial(link="probit")? I ran a typical probit model using the glm probit link and the nlminb function with my own coding of the loglikehood, separately. As nlminb does not
2008 Jun 19
1
Optim() violates constraints
Hi, I am using the mle2 method of the package 'bbmle'. The method is calling as far as I understood it the optim method "L-BFGS-B" (this is the method I use). The latter one allows the user to impose box constraints on the variables, i.e. to give lower and upper bounds. It is important that the initial values satisfy the constraints. In...
2009 Jul 03
1
is AIC always 100% in evaluating a model?
Hello, I'd like to say that it's clear when an independent variable can be ruled out generally speaking; on the other hand in R's AIC with bbmle, if one finds a better AIC value for a model without the given independent variable, versus the same model with, can we say that the independent variable is not likely to be significant(in the ordinary sense!)? That is, having made a lot of models from a data set, then the best two are say 78.2 an...
2008 Sep 10
1
using function instead of formula in plm
Hi all, I am trying to use plm to estimate coefficients in a model consisting of a system of equations. So far I used mle2 from the package "bbmle", but now I need to test for autocorrelation and mle2 does not provide for the necessary tests. mle2 needs a function as input that might as well consist of many different equations. plm however requires an object of class formula that needs to be included in the plm-call. Does anyone know if...
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 -sum(dnorm(y,mean=Y.pred,sd=sigma,log=TRUE)) } SigA<-mle2(linregfun, start=list(a=0.5, b=2), data=RegData) #Or SigB<-mle2(y~dnorm(mea...
2012 Mar 14
1
Glm and user defined variance functions
Hi, I am trying to run a generalized linear regression using a negative binomial error distribution. However, I want to use an overdispersion parameter that varies (dependent on the length of a stretch of road) so glm.nb will not do. >From what I've read I should be able to do this using GLM by specifying my own quasi family and describing the variance function using varfun, validmu,
2012 Apr 18
1
error estimating parameters with mle2
Hi all, When I try to estimate the functional response of the Rogers type I equation (for the mle2 you need the package bbmle): > RogersIbinom <- function(N0,attackR2_B,u_B) {attackR2_B+u_B*N0} > RogersI_B <- mle2(FR~dbinom(size=N0,prob=RogersIbinom(N0,attackR2_B,u_B)/N0),start=list(attackR2_B=4.5,u_B=0.16),method="Nelder-Mead",data=data5) I get following error message Error in optim(par = c(4....
2007 Sep 02
1
buglet in dist() ?
...;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods" [7] "base" other attached packages: bbmle nlme "0.7.7" "3.1-84"
2012 Nov 11
1
maximum likelihood estimation in R
I want to find ML estimates of a model using mle2 in bbmle package. When I insert new parameters (for new covariates) in model the log-likelihood value does not change and the estimated value is exactly the initial value that I determined. What's the problem? This is the code and the result: As you see the estimated values for b2 , b3 and b4 are the...
2009 Mar 21
1
Goodness of fit for negative binomial model
Dear r list,   I am using glm.nb in the MASS package to fit negative binomial models to data on manta ray abundance, and AICctab in the bbmle package to compare model IC.  However, I need to test for the goodness of fit of the full model, and have not been able to find a Pearson's Chi Squared statistic in any of the output.  Am I missing it somewhere?  Is there a way to run the test using either chisq.test() or goodfit()?  I would ap...
2012 Feb 23
0
error in optim: initial value in 'vmmin' is not finite
...I know it's a common problem, and I've carefully searched and readed all the posts about the issue, But, I can't find a solution. It looks like it will be a small piece of my code, but I'm unable to find it. Maybe anyone could help me... Here is my data and the code: > library(bbmle) Loading required package: stats4 Loading required package: numDeriv Loading required package: lattice Loading required package: MASS Warning message: package 'bbmle' was built under R version 2.12.2 > Cov<-read.table("f:/Arribes/NutriaPopMod.csv", header=TRUE, sep=",&...