Displaying 20 results from an estimated 300 matches similar to: "mle function"
2008 Oct 09
2
Help MLE
Dear,
I'm starting on R language. I would like some help to implement a MLE
function.
I wish to obtain the variables values (alpha12, w_g12, w_u12) that maximize
the function LL = Y*ln(alpha12 + g*w_g12 + u*w_u12).
Following the code:
rm(list=ls())
ls()
library(stats4)
Model = function(alpha12,w_g12,w_u12)
{
Y = 1
u = 0.5
g = -1
Y*log(alpha12 + g*w_g12 + u*w_u12)
}
res =
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
2007 Sep 10
1
MLE Function
I am just trying to teach myself how to use the mle function in R because it is much better than what is provided in MATLAB. I am following tutorial material from the internet, however, it gives the following errors, does anybody know what is happening to cause such errors, or does anybody know any better tutorial material on this particular subject.
>
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)
2007 Sep 11
1
Fitting Data to a Noncentral Chi-Squared Distribution using MLE
Hi, I have written out the log-likelihood function to fit some data I have (called ONES20) to the non-central chi-squared distribution.
>library(stats4)
>ll<-function(lambda,k){x<-ONES20; 25573*0.5*lambda-25573*log(2)-sum(-x/2)-log((x/lambda)^(0.25*k-0.5))-log(besselI(sqrt(lambda*x),0.5*k-1,expon.scaled=FALSE))}
> est<-mle(minuslog=ll,start=list(lambda=0.05,k=0.006))
2009 Oct 26
0
MLE for noncentral t distribution
Hi,
Actually I am facing a similar problem. I would like to fit both an ordinary (symmetric) and a non-central t distribution to my (one-dimensional) data (quite some values.. > 1 mio.).
For the symmetric one, fitdistr or funInfoFun (using fitdistr) from the qAnalyst package should do the job, and for the non-central one.. am I right to use
gamlss(x ~ 1, family=GT()) ?
Anyway, I am a little
2008 Mar 28
0
Estimating variance components of groups of covariates within regression model
I am interested in estimating the variance components from different groups of
variables in a linear regression.
For example, I want to model dependent variable ?Y? based on six covariates as
follows: (these are land use types measured at three scales for each Y,
"Local", "Riparian", and "Catchment" - these are not nested as there is a
unique area for each Y -
2008 Oct 23
1
distribution fitting
Dear R-help readers,
I am writing to you in order to ask you a few questions about distribution
fitting in R.
I am trying to find out whether the set of event interarrival times that I
am currently analyzing is distributed with a Gamma or General Pareto
distribution. The event arrival granularity is in minutes and interarrival
times are in seconds, so the values I have are 0, 60, 120, 180, and
2010 Aug 19
1
Help with Vectors and conditional functions
Good morning,
I have something like this: names(coint_tests) <- apply(b,2,paste, collapse="_") which prints 15 names like: A_B, C_D, E_F, ...
AA,B,C,D.. Are time series. Then there is a vector called coint_tests of length 15 which yields "yes" or "no".
I need to add a function to plot the time series Ai_Bi if the coint_tests vectors gives me a "YES".
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
2011 Feb 25
0
Fitting distribution in range
Hello.
I am trying to fit my data sample x with different distributions such that
the integral from min(x) to max(x) of the fitted distribution will be one.
Therefore I have wrote my own log-likelihood functions and then I am using
mle {stats4}. So, for example:
ll_gamma <- function(a,b) {
integrand <- function(y){dgamma(y, shape=a, rate=b)}
integ_res <-
2005 Sep 06
2
fitting distributions with R
Dear all
I've got the dataset
data:2743;4678;21427;6194;10286;1505;12811;2161;6853;2625;14542;694;11491;
?? ?? ?? ?? ?? 14924;28640;17097;2136;5308;3477;91301;11488;3860;64114;14334
I know from other testing that it should be possible to fit the data with the
exponentialdistribution. I tried to get parameterestimates for the
exponentialdistribution with R, but as the values
of the parameter
2008 Jun 19
1
try to find the MLE of a function
Hi everyone:
I have a density function f(x|theta)=theta*x^(theta-1),where
0<x<1,0<theta<infinite
I want to pratice on R to find the MLE of this function,here is my code:
x <- (0:10)/10
f<-function(theta) prod(theta*x^(theta-1))
mle(f)
and r gave me :Error in eval(expr, envir, enclos) : argument is missing,
with no default
what mistake I just made?and how to add a
2006 Oct 16
1
MLE Methods
Greetings Forum,
I am new to R and and writing in hopes of getting some help.
Our MLE results from a home grown software do not match with that of R. We are using a censored sample and will really appreciate if you could give us any pointers as to which MLE method is used in R... to my knowledge there are different flavors of MLE used.
Thanks in Advance...
2009 Oct 06
2
mle from stats4
I am using mle as a wrapper from optim( ). How would I extract the
convergence code, to know that optim( ) converged properly?
Thanks,
Stephen Collins, MPP | Analyst
Global Strategy | Aon Benfield
[[alternative HTML version deleted]]
2008 Jan 22
2
MLE for censored distributions in R
Hi just wondering if there is a package that can get the maximum likelihood
or method of moments estimator for distributions with censored data? The
distributions I'm interested in are: Exponential, pareto, beta, gamma and
lognormal.
--
View this message in context: http://www.nabble.com/MLE-for-censored-distributions-in-R-tp15022863p15022863.html
Sent from the R help mailing list archive at
2009 Feb 06
1
MLE for right-censored data with covariates
I am a student (and very to new to R) working on a senior design project that
is attempting to determine the demand distributions for single copy
newspaper draws at individual sales outlet locations. Our sales data is
right-censored, because sell-outs constitute a majority of the data, and we
are also testing the relevance of including covariates (weather,
seasonality, economic condition, etc.).
2007 Mar 29
0
to use EM algorithm for MLE
hi,
I want to use EM for MLE estimation.WHAT would be the relevant package or
code??
Regards,
Subhajit.
[[alternative HTML version deleted]]
2009 Feb 13
0
The effect of MLE and MME to probability of rejection
Hi I am beginner with R
I would like to compare the performance of Maximum likelihood Estimator
(MLE) and Method of Moment Estimator (MME) effect probability of rejection,
p. My MLE is
x=rlnorm(10,meanlog = 2, sdlog =5)
x
xbar=mean(x)
ssqrt=var(x)
xbar
ssqrt
#MLE
y=log(x)
m1=mean(y)
s1=var(y)
m1
s1
#MME
m2=log(xbar^2/sqrt(ssqrt+xbar^2))
s2 = log((ssqrt+xbar^2)/xbar^2)
m2
2003 Nov 24
1
mle in the gamma model
Dear [R]-list,
I'm looking for a classic equivalent of the wle.gamma function (library
wle) that estimate robustly the shape and the scale parameters of gamma
data.
I have a vector of iid gamma rv :
>data=rgamma(100,shape=10,scale=3)
and a vector of their weights:
>weights=c(rep(.5/70,70),rep(.25/20,20),rep(.25/10,10))
and want to estimate the scale and shape of the gamma