Displaying 7 results from an estimated 7 matches for "mlogl".
Did you mean:
mlog
2008 May 22
1
Computing Maximum Loglikelihood With "nlm" Problem
Hi,
I tried to compute maximum likelihood under gamma distribution,
using nlm function. The code is this:
__BEGIN__
vsamples<- c(103.9, 88.5, 242.9, 206.6, 175.7, 164.4)
mlogl <- function(alpha, x) {
if (length(alpha) > 1) stop("alpha must be scalar")
if (alpha <= 0) stop("alpha must be positive")
return(- sum(dgamma(x, shape = alpha, log = TRUE)))
}
mlogl_out <- nlm(mlogl, mean(vsamples),vsamples=vsamples)
print(mlogl_out)...
2007 Apr 18
3
Problems in programming a simple likelihood
As part of carrying out a complicated maximum likelihood estimation, I
am trying to learn to program likelihoods in R. I started with a simple
probit model but am unable to get the code to work. Any help or
suggestions are most welcome. I give my code below:
************************************
mlogl <- function(mu, y, X) {
n <- nrow(X)
zeta <- X%*%mu
llik <- 0
for (i in 1:n) {
if (y[i]==1)
llik <- llik + log(pnorm(zeta[i,], mean=0, sd=1))
else
llik <- llik + log(1-pnorm(zeta[i,], mean=0, sd=1))
}
return(-llik)
}
women <- read.table("~/R/Examples/W...
2009 Jun 19
1
a difficulty in boot package
Hi,
I have a problem in programming for bootstrapping.
I don't know why it show the error message.
Please see my code below:
#'st' is my original dataset.
#functions of 'fml.mlogl','pcopula.fam4','ltd','invltd' are already defined
boot.OR<-function(data,i)
{
E=data[i,]
ml1<-glm(c_VAsex90_bf ~ trt,family=binomial,data=E)
ml2<-glm(c_VAsex90_bm ~ trt,family=binomial,data=E)
marg.covariates<-cbind(rep(1,length(E$trt)),E$trt)
dep.covariate...
2007 Jul 18
2
maximum likelihood estimation
Hello!
I need to perform maximum likelihood estimation on R, but I am not sure
which command to use. I searched on google, and found an example using the
function mlogl, but I couldn't find the package on R. Is there such
function? Or how should i perform my mle?
Thank you very much.
--
View this message in context: http://www.nabble.com/maximum-likelihood-estimation-tf4103791.html#a11670424
Sent from the R help mailing list archive at Nabble.com.
2008 May 23
0
Est. Component Size with AIC/BIC under Gamma Distribution
Dear all,
I am trying to model number of samples from
a given series. The series are modelled according
Gamma function.
In order to estimate the # samples, I use BIC/AIC
with MLE (computed from dgamma function).
Here is the code I have.
__BEGIN__
mlogl <- function( x_func, theta_func, samp) {
# computing log_likelihood
return( - sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE)))
}
find_bic <- function(mll,smpl,k) {
bic <- (-2 * mll) + (k * log(length(smpl)))
bic
}
find_aic <- function(mll,smpl,k) {...
2009 Jan 18
1
about power.law.fit
Dear all,
I'm using igraph for some analysis about the network I have. I have a
question about the function "power.law.fit".
I wonder if there is any test for checking whether the "power.law.fit" is
good for the input, i.e., under which situation, could we use this function
to get a reliable result. I'm afraid even I input a random graph without any
property of
2006 Feb 15
1
power law
Dear list,
Does anyone know how to fit the power law distribution?
I have the empirical distribution and would like to check whether it fits
power law (with the power estimated from the data).
Any hints are appreciated
Best regards
Galina
[[alternative HTML version deleted]]