similar to: overhaul of mle

Displaying 20 results from an estimated 5000 matches similar to: "overhaul of mle"

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) {
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
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 <-
2005 Jul 27
1
Problem specifying "function" for "mle" operation
Hello fellow R users, Below are two cases using the "mle" operation from the stats4 package. In CASE 1 the code runs fine, in CASE 2 errors occur: CASE 1 x, alpha_current, s, and n are vectors 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
2005 Jul 21
1
About object of class mle returned by user defined functions
Hi, There is something I don't get with object of class "mle" returned by a function I wrote. More precisely it's about the behaviour of method "confint" and "profile" applied to these object. I've written a short function (see below) whose arguments are: 1) A univariate sample (arising from a gamma, log-normal or whatever). 2) A character string
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
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: >
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
2018 May 28
2
to R Core T: mle function in 32bits not respecting the constrain
I have an issue using mle in versions of 32 bits. I am writing a package which I want to submit to the CRAN. When doing the check, there is an example that has an error running in the 32 bits version. The problem comes from the mle function, using it with a lower constrain. In 64 bits version it works fine but when I put it in the R 32 bits it fails. (same numbers, all equal!) The call is:
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) {
2018 May 28
0
to R Core T: mle function in 32bits not respecting the constrain
> On May 27, 2018, at 10:31 PM, francesc badia roca <fbr600 at gmail.com> wrote: > > I have an issue using mle in versions of 32 bits. > > I am writing a package which I want to submit to the CRAN. > When doing the check, there is an example that has an error running in the > 32 bits version. > > The problem comes from the mle function, using it with a lower
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),
2008 Mar 11
1
messages from mle function
Dears useRs, I am using the mle function but this gives me the follow erros that I don't understand. Perhaps there is someone that can help me. thank you for you atention. Bernardo. > erizo <- read.csv("Datos_Stokes_1.csv", header = TRUE) > head(erizo) EDAD TALLA 1 0 7.7 2 1 14.5 3 1 16.9 4 1 13.2 5 1 24.4 6 1 22.5 > TAN <-
2008 Sep 04
1
pass data to log-likelihood function
Hi there, When I do bootstrap on a maximum likelihood estimation, I try the following code, however, I get error: Error in minuslogl(alpha = 0, beta = 0) : object "x" not found It seems that mle() only get data from workspace, other than the boot.fun(). My question is how to pass the data to mle() in my case. I really appreciated to any suggestions. Best wishes, Jinsong
2006 Jun 06
2
How to create list of objects?
Hi I am doing several mle and want to store them in a list (or whatever is the right construct) to be able to analyse them later. at the moment I am doing: f <- list() f$IP <- mle(...) f$NE <- mle(...) but when I say: > summary(f) I get: Length Class Mode IP 0 mle list NE 0 mle list I don't get the output I would have, i.e. the one from >
2011 May 23
6
Reading Data from mle into excel?
Hi there, I ran the following code: vols=read.csv(file="C:/Documents and Settings/Hugh/My Documents/PhD/Swaption vols.csv" , header=TRUE, sep=",") X<-ts(vols[,2]) #X dcOU<-function(x,t,x0,theta,log=FALSE){ Ex<-theta[1]/theta[2]+(x0-theta[1]/theta[2])*exp(-theta[2]*t) Vx<-theta[3]^2*(1-exp(-2*theta[2]*t))/(2*theta[2]) dnorm(x,mean=Ex,sd=sqrt(Vx),log=log) }
2005 Sep 06
2
(no subject)
my problem actually arised with fitting the data to the weibulldistribution, where it is hard to see, if the proposed parameterestimates make sense. data1:2743;4678;21427;6194;10286;1505;12811;2161;6853;2625;14542;694;11491; ?? ?? ?? ?? ?? 14924;28640;17097;2136;5308;3477;91301;11488;3860;64114;14334 how am I supposed to know what starting values i have to take? i get different
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
2007 Apr 09
1
R:Maximum likelihood estimation using BHHH and BFGS
Dear R users, I am new to R. I would like to find *maximum likelihood estimators for psi and alpha* based on the following *log likelihood function*, c is consumption data comprising 148 entries: fn<-function(c,psi,alpha) { s1<-sum(for(i in 1:n){(c[i]-(psi^(-1/alpha)*(lag(c[i],-1))))^2* (lag(c[i],-1)^((-2)*(alpha+1)) )}); s2<- sum(for(m in 1:n){log(lag(c[m],-1)^(((2)*alpha)+2))});
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