Displaying 20 results from an estimated 200 matches similar to: "How to use mle or similar with integrate?"
2004 Jun 10
1
overhaul of mle
So, I've embarked on my threatened modifications to the mle subset
of the stats4 package. Most of what I've done so far has *not* been
adding the slick formula interface, but rather making it work properly
and reasonably robustly with real mle problems -- especially ones
involving reasonably complex fixed and default parameter sets.
Some of what I've done breaks backward
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),
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
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 Oct 24
1
vectorized mle / optim
Hi the list,
I would need some advice on something that looks like a FAQ: the
possibility of providing vectors to optim() function.
Here is a stupid and short example summarizing the problem:
-------------------------------- example 1 ------------ 8<
----------------------
library(stats4)
data <- rnorm(100,0,1)
lik1 <- function(m, v, data) {
N <- length(data)
lik.mean <-
2009 Sep 04
2
Nested Fixed Effects - basic questions
Hi R people,
I have a very basic question to ask - I'm sorry if it's been asked before, but I searched the archives and could not find an answer. All the examples I found were much more complicated/nuanced versions of the problem - my question is much more simple.
I have data with multiple, nested fixed effects (as I understand it, fixed effects are specified by the experimental design
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
2013 Feb 03
1
Fractional logit in GLM?
Hi,
Does anyone know of a function in R that can handle a fractional variable as the dependent variable? The catch is that the function has to be inclusive of 0 and 1, which betareg() does not.
It seems like GLM might be able to handle the fractional logit model, but I can't figure it out. How do you format GLM to do so?
Best,
Rachael
[[alternative HTML version deleted]]
2007 Dec 06
1
suggested modification to the 'mle' documentation?
Hello:
I wish to again express my appreciation to all who have
contributed to making R what it is today.
At this moment, I'm particularly grateful for whoever modified the
'mle' code so data no longer need be passed via global variables. I
remember struggling with this a couple of years ago, and I only today
discovered that it is no longer the case.
I'd
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)
2019 Apr 24
1
Bug in "stats4" package - "confint" method
Dear R developers,
I noticed a bug in the stats4 package, specifically in the confint method applied to ?mle? objects.
In particular, when some ?fixed? parameters define the log likelihood, these parameters are stored within the mle object but they are not used by the ?confint" method, which retrieves their value from the global environment (whenever they still exist).
Sample code:
>
2014 Jan 26
2
[LLVMdev] [llmdev] fail to process llvm generated assembly on windows/mingw32
Hello guys,
I'm using llvm 3.3 on windows with mingw (triple: "i386-unknown-mingw32")
to compile IR code that my
program generates.
I do it in two phases: first I emit assembly code and then assemble it.
TargetMachine targetMachine =
target.createTargetMachine(triple);
targetMachine.setAsmVerbosityDefault(true);
targetMachine.setFunctionSections(true);
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
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
2006 Feb 02
2
how to use mle?
>Y
[,1] [,2] [,3]
[1,] 0 1 0
[2,] 0 1 0
[3,] 0 0 1
[4,] 1 0 0
[5,] 0 0 1
[6,] 0 0 1
[7,] 1 0 0
[8,] 1 0 0
[9,] 0 0 1
[10,] 1 0 0
>X
pri82 pan82
1 0 0
2 0 0
3 1 0
4 1 0
5 0 1
6 0 0
7 1 0
8 1 0
9 0 0
10
2011 May 03
6
Simple loop
Hello everybody,
I am beginning with loops and functions and would be glad to have help in
the following question:
If i have a dataframe like this
Site Prof H
1 1 24
1 1 16
1 1 67
1 2 23
1 2 56
1 2 45
2 1 67
2 1 46
And I would like to create a new column that subtracts the minimum of H from
H, but for S1 and P1
only
2016 Apr 26
1
[PATCH] image embedding can result in flac file corruption
Currently it's possible to corrupt FLAC file with flac and metaflac tools.
If image filesize is just slightly less than 2^24 bytes then the size of
PICTURE metadata block will be more that this limit.
The first patch (fix1.patch) adds additional check in /share/grabbag/picture.c/read_file()
and removes rather useless check from FLAC__metadata_object_picture_set_data().
It's enough to fix
2004 Nov 17
1
frailty and time-dependent covariate
Hello,
I'm trying to estimate a cox model with a frailty variable and time-dependent covariate (below there is the statement I use and the error message). It's seems to be impossible, because every time I add the time-dependent covariate the model doesn't converge. Instead, if I estimate the same model without the time-dependent covariate it's converge. I'd like knowing if
2009 Jul 01
2
xen-tools: does not unmount disks and mounts proc into the new VM - why?
Hi!
I am using xen-tools version: 3.9-4 to create domUs:
1. time xen-create-image --verbose --dist=lenny
--install-source=/mnt/xen-file-images/lenny-64-template-debootstrap-30Jun09-fix2.tar --hostname dummy --ip xxx.xxx.xxx.xxx --force
2. xm create dummy.cfg
Then I get the message
Device /dev/vg0/dummy-disk is mounted in the privileged domain,
and so cannot be mounted by a guest.
3. When I
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