Displaying 8 results from an estimated 8 matches for "fullcoef".
2004 Jun 10
1
overhaul of mle
...rs into lists [this seems harmless to me -- is there a
reason not to allow the user to specify a named vector rather than a
list? especially since start gets sapply'd back to a vector before it
gets passed to optim() anyway?]
Added some (probably not quite right) code to mle to make sure that
fullcoef gets evaluated properly when (1) the list contains
expressions and (2) the list contains expressions that depend on other
arguments e.g. fixed = list(a=y,b=x[y])
I used
fullcoef <- lapply(fullcoef,eval,envir=fullcoef,
enclos=parent.frame(100))
but there may well be...
2019 Apr 24
1
Bug in "stats4" package - "confint" method
...erous because it?s silent and in case the user changes the value of ?y? for another purpose the method ?confint? will return a wrong evaluation of the confidence interval without throwing any warning.
I suggest to use the fixed values that are already contained within the mle object:
> fit0 at fullcoef[grep('y', names(fit0 at fullcoef))]
y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11
26 17 13 12 20 5 9 8 5 4 8
Additionally, the method ?coef? returns both the coefficient and the fixed parameters - while should return only the parameters - , while the ?fullcoef? method is n...
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
2007 Oct 24
1
vectorized mle / optim
...lik.mean - lik.var)
}
ml.result <- mle(lik2b, start=list(param=c(m=2, v=2)),
fixed=list(data=data))
---------------------------------------------------------------------------------------
"Error in validObject(.Object) :
invalid class "mle" object: invalid object for slot "fullcoef" in
class "mle": got class "list", should be or extend class "numeric""
The example above is very stupid, but there are cases where the estimate
of vectors of parameters can hardly be avoided. In particular, I'm
working with time series models with ra...
2006 Feb 02
2
how to use mle?
...=J,nrow=K)
fit <- X%*%B
p<-exp(fit)/rowSums(exp(fit))
Yp <- Y-p
Yp<-matrix(rep(t(Yp),each=K),ncol=K*J,by=T)
X <- matrix(rep(X,J) ,ncol=K*J)
apply(Yp*X,2,sum)
}
library(stats4)
mle(LL)
Error in validObject(.Object) : invalid class "mle" object: invalid
object for slot "fullcoef" in class "mle": got class "list", should be
or extend class "numeric"
mle(LL,gr=grad)
Error in optim(start, f, method = method, hessian = TRUE, ...) :
gradient in optim evaluated to length 6 not 0
what is wrong with my code?I try to fix it myself but fa...
2005 Jul 27
1
Problem specifying "function" for "mle" operation
...rs of the same length.
ll_beta<-function(b0=0,b1=0) -sum(s*b0+s*b1*x+s*alpha_current-n*log(1+exp(b0+b1*x+alpha_current)))
fit_beta<-mle(ll_beta)
CASE 2
The error message is as follows => Error in validObject(.Object) : invalid class "mle" object: invalid object for slot "fullcoef" in class "mle": got class "list", should be or extend class "numeric"
x,s,n, and alpha are vectors of the same length (5 dimensions in this specific case).
ll_alpha<-function(alpha=c(0.5,0.5,0.5,0.5,0.5)) -sum(s*b0+s*b1*x+s*alpha-n*log(1+exp(b0+b1*x+alpha))-...
2006 Oct 31
0
help with extended mle package?
...ing that
a function-defining-function (e.g. something like
minusloglfun <- function(data) {
with(data,
function(param1,param2) {
[negative log-likelihood expression]
})
) was a good solution.
I also had some confusion/misunderstanding about the differences
between the fullcoef and coef slots within the mle object.
Since then I've done a fair amount with my version
of mle() [bbmle, available from
http://www.zoo.ufl.edu/bolker/R/src/bbmle_0.3.0.tar.gz ] ;
- confidence limits estimated by spline back-fitting
(as in base mle package) OR uniroot (for higher precisi...
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