Displaying 20 results from an estimated 3000 matches similar to: "mle from stats4"
2009 Sep 28
1
Using linear formula inside MLE
Say I have a formula Y ~ 1 + X, where X is a categorical variable. A
previous thread showed how to evaluate this model using the mle package
from "stats4" (see below). But, the user had to create the data matrix,
X, including the column of one's for the regression constant. Is there a
way to nest the linear formula in the code below, so the data matrix
doesn't explicitly
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
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),
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 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 Oct 07
1
2 questions about mle() /optim() function in stats4
Dear All,
There are two things about mle() that I wasn't so sure.
1) can mle() handle vector based parameter? say
ll<-function(theta=rep(1,20)){..............}
I tried such function, it worked for "optim" but not for "mle".
2) is there a general suggestion for the maximum number of parameters
allowed to use in mle() or optim()?
Thank you.
Regards,
MJO
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
2009 Feb 10
1
loglik and arima()
All -
I am evaluating an arima(2,1,3) and arima(3,1,3) and notice the
log-likelihood of the restricted model is higher than the log-likelihood
of the unrestricted.
Since these are nested models, I thought the unrestricted model would have
a log-likelihood at least as large as that of the restricted model. Am I
interpreting the "loglik" output incorrectly?
Regards,
Stephen
2008 Sep 25
2
Two overlaid density plots - Does order matter?
In the following code, the only difference between the two plots is the
order the variables are plotted. In this case, the plot of "cdata.den" in
plot #1 is different from its plot in #2. Specifically, "cdata.den" spans
the x-axis from -5 to 30 in plot #1 and from 0 to 20 in plot #2. Does
anyone understand why these two plots do not yield the same result?
#Make density
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
2008 Nov 07
2
Vectorizing sample()
I am simulating sickness among a group of families. Part of the task is
to randomly draw who in the family will be sick, randomly drawing from
family ID's where Dad =1, Mom = 2, Kid1 = 3, Kid2 = 4., etc. My census of
Dads is of the form shown below.
Dad_ID Spouse (Y=1;N=0) #Kids #People_Becoming_Sick
1 1 0 1
2
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
2008 Nov 12
0
How fast of a desktop can I buy?
I currently run simulations on an IBM x31 Thinkpad (laptop), with an Intel
Pentium M, 1.3GHz processor. I am planning to buy a desktop to help speed
up my work, but I am wondering if R is compatible with some of the newer
technology that has come to market (i.e., Intel Core 2 Duo, Quad Core
processors, 64-bit operating systems).
Does anyone know the threshold or limit on R's
2006 Oct 24
2
Installing stats4 package
Hi,
I wantto use 'mle' function in R on linux. As I see its been integrated
into the stats4 package. Am I correct ? If yes, Can anyone suggest how to
install the stats4 package to be able to run 'mle' function in R on linux ?
Otherwise how to sort out this problem ?
Thanks
Himanshu
[[alternative HTML version deleted]]
2014 Jul 06
2
Depot for S3 to S4 generics (as in stats4)?
Dear developers,
the implementation of S4 generics for existing S3 ones in the base
package is concerned to be a threat to quick startup times [1]. But
since S4 is promoted, and S3/S4 interoperability a pain when package
developing [2], are there efforts to improve the situation? E.g. an S3
free system, etc.
A good thing [2] is the package 'stats4', including some setGeneric
calls (e.g.
2018 Jan 12
5
Help with packages (methods, stats, stats4)
hello,
Can you please give me a hand with this problem,well i can't install these
packages:
- stats
- methods
- stats4
when i tried the following command : *library(help = "stats") * , it gave
me this output (*see picture*), so i contacted the Maintainer of the
package at (*R-core at r-project.org <R-core at r-project.org>*) but he said that
i write to the wrong place.
(i
2008 May 08
3
MLE for noncentral t distribution
I have a data with 236 observations. After plotting the histogram, I found that it looks like non-central t distribution. I would like to get MLE for mu and df.
I found an example to find MLE for gamma distribution from "fitting distributions with R":
library(stats4) ## loading package stats4
ll<-function(lambda,alfa) {n<-200
x<-x.gam
2018 Jan 12
2
Help with packages (methods, stats, stats4)
Hi,
Did you try install.packages('stats').
Let we know about your Sys.info()
Karim
On Fri, Jan 12, 2018 at 5:37 PM, imane hajar <imane.chafiki.fst at gmail.com>
wrote:
> hello ,
>
> i am so sorry , i figure it out.
>
> im sending this msj to the moderator to stop the approval of the mail .
>
> have a good day.
>
>
> 2018-01-12 15:42 GMT+00:00 imane
2018 Jan 12
0
Help with packages (methods, stats, stats4)
hello ,
i am so sorry , i figure it out.
im sending this msj to the moderator to stop the approval of the mail .
have a good day.
2018-01-12 15:42 GMT+00:00 imane hajar <imane.chafiki.fst at gmail.com>:
> hello,
> Can you please give me a hand with this problem,well i can't install
> these packages:
> - stats
> - methods
> - stats4
>
> when i tried the
2008 Dec 11
1
help with predict in stats4
Hi,
We're using stats4 for a logistic regression. The code is
chdreg.logit2 <- glm(chd ~ age + sex, family = binomial)
summary(chdreg.logit2)
oddsratios <- coef(chdreg.logit2)
exp(oddsratios)
# Calculate model predicted values
pred <- predict(chdreg.logit2,type="response")
The glm part runs fine, and up to now so has the predict function.
However, now we're