Displaying 20 results from an estimated 3000 matches similar to: "strategies for incorporating a data= argument"
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 Jan 17
0
nls profile with port/constraints
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 below ...
If I can I will try to hack the code, but I will
probably start by redefining my function with
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) {
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
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 <-
2006 Oct 24
0
Variables ordering problem in mle() (PR#9313)
Full_Name: S?bastien Villemot
Version: 2.4.0
OS: Debian testing
Submission from: (NULL) (62.212.121.128)
Hi,
In the mle() function of the stats4 package, there is a bug in the ordering of
the variables given in the 'start' argument.
By just changing the order of the variables listed in the 'start' list (the
initialization values), it is possible to obtain different estimation
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
2011 May 23
0
Error in backSpline.npolySpline(sp) : spline must be monotone
I get the following error:
Error in backSpline.npolySpline(sp) : spline must be monotone
Has anyone had this error before? any ideas on a workaround?
>
> 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){
+
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
2009 Nov 04
1
compute maximum likelihood estimator for a multinomial function
Hi there
I am trying to learn how to compute mle in R for a multinomial negative
log likelihood function.
I am using for this the book by B. Bolker "Ecological models and data in
R", chapter 6: "Likelihood an all that". But he has no example for
multinomial functions.
What I did is the following:
I first defined a function for the negative log likelihood:
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
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
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))});
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
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
2011 Aug 05
0
[Bug 14647] profile.mle can not get correct result
Thank you very much.
now, i call
mle(minuslogl=loglik, start=start, method <<- method, fixed=list())
in the mle.wrap() function, and the profile.mle() worked.
however, it created a variable named "method" in user workspace. if
there had been a variable with same name, then the value of that
variable would be destroyed.
Is there a way to avoid that happen? Thanks again.
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 <-
2005 Feb 01
1
Error in load(dataFile, myEnv)
Dear all,
I just found that some of the packages are not able to load any more,
after I installed R2.0.1 in my Mac, it even affects my old R1.8
installs.
It gives me errors when I load packages that contains "myEnv" settings.
such as: RMySQL, DBI, Rggobi, etc. But others that does not require
"myENV" is all right, like tcltk that only calls the c functions.
The errors
2011 Jul 25
1
do.call in "with" construction
Dear all,
I'd appreciate any help to rectify what must be a misconception of mine how
environments work:
##########################
myEnv <- new.env()
myEnv$a.env <- 1
myEnv$symbols.env <- "a.env"
a.global <- 2
symbols.global <- "a.global"
myFun <- function(symbols){do.call("print", lapply(symbols, FUN=as.name))}
do.call("myFun",
2020 May 12
0
S3 method dispatch for methods in local environments
Dear Wolfgang,
I think this new behaviour is related to the following R 4.0.0 NEWS item:
> S3 method lookup now by default skips the elements of the search path between the global and base environments.
Your environment "myenv" is attached at position 2 of the search() path
and thus now skipped in S3 method lookup.
I have just noticed that