Displaying 20 results from an estimated 1000 matches similar to: "suggested modification to the 'mle' documentation?"
2006 Jun 23
1
How to use mle or similar with integrate?
Hi
I have the following formula (I hope it is clear - if no, I can try to
do better the next time)
h(x, a, b) =
integral(0 to pi/2)
(
(
integral(D/sin(alpha) to Inf)
(
(
f(x, a, b)
)
dx
)
dalpha
)
and I want to do an mle with it.
I know how to use mle() and I also know about integrate(). My problem is
to give the parameter values a and b to the
2008 Feb 12
1
Namespace/method oddity
I stumbled on the following:
> library(stats4)
> example(mle)
> confint.default(fit2)
Error in UseMethod("vcov") : no applicable method for "vcov"
In addition: Warning message:
In object$coefficients :
$ operator not defined for this S4 class, returning NULL
> vcov(fit2)
lymax lxhalf
lymax 0.02857612 -0.04870231
lxhalf -0.04870231 0.11457338
2007 Jul 29
1
behavior of L-BFGS-B with trivial function triggers bug in stats4::mle
With the exception of "L-BFGS-B", all of the
other optim() methods return the value of the function
when they are given a trivial function (i.e., one with no
variable arguments) to optimize. I don't think this
is a "bug" in L-BFGS-B (more like a response to
an undefined condition), but it leads to a bug in stats4::mle --
a spurious error saying that a better fit
has been
2006 Dec 30
3
wrapping mle()
Hi,
How can we set the environment for the minuslog function in mle()? The
call in this code fails because the "ll" function cannot find the object
'y'. Modifying from the example in ?mle:
library(stats4)
ll <- function(ymax=15, xhalf=6) {
-sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
}
fit.mle <- function(FUN, x, y) {
loglik.fun <- match.fun(FUN)
2004 Sep 13
2
Problem with mle in stats4 (R 1.9.1)
Hi!
This is a repost of an earlier message (with a clearer example
demonstrating the problem I ran into). If you run the mle example in
stats4
library(stats4)
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))
(fit <- mle(ll))
plot(profile(fit),
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,
2007 Aug 13
1
[Fwd: behavior of L-BFGS-B with trivial function triggers bug in stats4::mle]
I sent this in first on 30 July. Now that UseR! is over I'm trying again
(slightly extended version from last time).
With R 2.5.1 or R 2.6.0 (2007-08-04 r42421)
"L-BFGS-B" behaves differently from all of the
other optim() methods, which return the value of the function
when they are given a trivial function (i.e., one with no
variable arguments) to optimize. This is not
a bug in
2004 Dec 09
2
wishlist -- names gives slotnames (PR#7410)
Full_Name: Elizabeth Purdom
Version: 1.9.1
OS: Windows XP
Submission from: (NULL) (171.64.102.199)
It would be nice if names(obj) would give slot names as well. Since for many
people slots are new, the first thing that happens is you try to access what's
in them and can't find how to do it. If you don't know that slotNames() exists,
it can be very frustrating. Moreover, if you
2012 May 13
2
Discrete choice model maximum likelihood estimation
Hello,
I am new to R and I am trying to estimate a discrete model with three
choices. I am stuck at a point and cannot find a solution.
I have probability functions for occurrence of these choices, and then I
build the likelihood functions associated to these choices and finally I
build the general log-likelihood function.
There are four parameters in the model, three of them are associated to
2012 Sep 11
1
Strange result from GAMLSS
Hi Folks! Just started using the gamlss package and I tried a simple code
example (see below). Why the negative sigma?
John
> y <- rt(100, df=1)> m1<-fitDist(y, type="realline")Warning messages:1: In MLE(ll3, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, :
possible convergence problem: optim gave code=1 false convergence
(8)2: In MLE(ll4, start = list(eta.mu =
2006 Jan 25
0
Log-Likelihood 3d-plot and contourplot / optim() starting values
Hello,
i have coded the following loglikelihood-function
# Log-Likelihood-Funktion
loglik_jm<-function(N,phi,t) {
n<-length(t)
i<-seq(along=t)
s1<-sum(log(N-(i-1)))
s2<-phi*sum((N-(i-1))*t[i])
n*log(phi)+s1-s2
}
# the data
t<-c(7,11,8,10,15,22,20,25,28,35)
# now i want to do a 3d-plot and a contourplot in order to see at which
values of N and phi the loglikelihood
2003 Jul 24
5
inverse prediction and Poisson regression
Hello to all, I'm a biologist trying to tackle a "fish" (Poisson Regression) which is just too big for my modest understanding of stats!!!
Here goes...
I want to find good literature or proper mathematical procedure to calculate a confidence interval for an inverse prediction of a Poisson regression using R.
I'm currently trying to analyse a "dose-response"
2013 Jan 23
3
Pasting a list of parameters into a function
I need to repeat a function many times, with differing parameters held
constant across iterations. To accomplish this, I would like to create a
list (or vector) of parameters, and then insert that list into the function.
For example:
q<-("l,a,b,s")
genericfunction<-function(q){
}
######
The equivalent code would of course be
genericfunction<-function(l,a,b,s){
}
Any help
2011 Jan 27
3
Warning with mle
Hi there,
I'm pretty new to the field of fitting (anything). I try to fit a
distribution with mle, because my real data seems to follow a
zero-inflated poisson distribution. So far, I tried a simple example
to see whether I understand how to do it or not:
# example count data
x <- 0:10
y <- dpois(x, lambda = 1.4)
# zero-inflated poisson
zip <- function(x, lambda, prop) {
(1 -
2011 Apr 12
1
2-parameter MLE problems
Hi all,
Sorry for the re-post, I sent my previous e-mail before it was complete. I
am trying to model seroprevalence using the differential equation: dP/dt =
beta*seronegative*.001*(seropositive)-0.35*(0.999)*(seropositive)-r*seropositive.
I would like to estimate my two parameters, beta and r, using maximum
likelihood methods. I have included my code below:
2011 Feb 07
2
question mle again
A few day ago, I was looking for an answer to my question but didn't
get one. Anybody who can help now?
Hello,
I tried to use mle to fit a distribution(zero-inflated negbin for
count data). My call is very simple:
mle(ll)
ll() takes the three parameters, I'd like to be estimated (size, mu
and prob). But within the ll() function I have to judge if the current
parameter-set gives a nice
2011 Feb 01
1
mle question
Hello,
I tried to use mle to fit a distribution(zero-inflated negbin for
count data). My call is very simple:
mle(ll)
ll() takes the three parameters, I'd like to be estimated (size, mu
and prob). But within the ll() function I have to judge if the current
parameter-set gives a nice fit or not. So I have to apply them to
observation data. But how does the method know about my observed
2006 Jun 02
2
Problem with mle
R 2.3.0
Linux, SuSE 10.0
Hi
I have two problems with mle - probably I am using it the wrong way so
please let me know.
I want to fit different distributions to an observed count of seeds and
in the next step use AIC or BIC to identify the best distribution.
But when I run the script below (which is part of my original script), I
get one error message for the first call of mle:
Error in
2012 Jul 05
3
Maximum Likelihood Estimation Poisson distribution mle {stats4}
Hi everyone!
I am using the mle {stats4} to estimate the parameters of distributions by
MLE method. I have a problem with the examples they provided with the
mle{stats4} html files. Please check the example and my question below!
*Here is the mle html help file *
http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html
http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html
2013 May 18
3
bar plot with non-zero starting level
Hi,
I want to plot grouped bars to compare 95% confidence interval estimates
from two models. Each bar represents a 95% confidence interval estimate
of a coefficient from one of the two models. Each group represents
confidence interval estimates of the same coefficient from the two models.
I think such a bar plot will nicely present whether 95% confidence
interval estimates of the same