similar to: Lognormal with 0/1 "tag" [theoretical]

Displaying 20 results from an estimated 3000 matches similar to: "Lognormal with 0/1 "tag" [theoretical]"

2008 Feb 18
0
Solved (??) Behaviour of integrate (was 'Poisson-lognormal probab ility calculations')
Hi Again, I think I've solved my problem, but please tell me if you think I'm wrong, or you can see a better way! A plot of the integrand showed a very sharp peak, so I was running into the integrand "feature" mentioned in the note. I resolved it by limiting the range of integration as shown here: -------------------------------------------------- function (x, meanlog = 0,
2010 Apr 28
0
Truncated Lognormal Distribution
Hi! I have following data which is left truncated say at 10. I am trying to estimate the parameters of the Truncated Lognormal distribution to this data as given below. (I have referred to R code appearing in an earlier post - http://finzi.psych.upenn.edu/Rhelp10/2008-October/176136.html) library(MASS) x <- c(600.62,153.05,70.26,530.42,3440.29,97.45,174.51,168.47, 116.63,36.51, 219.77,
2008 Feb 15
0
Behaviour of integrate (was 'Poisson-lognormal probability calcul ations')
Hi again, Adding further information to my own query, this function gets to the core of the problem, which I think lies in the behaviour of 'integrate'. ------------------------------------- function (x, meanlog = 0, sdlog = 1, ...) { require(stats) integrand <- function(t, x, meanlog, sdlog) dpois(x,t)*dlnorm(t, meanlog, sdlog) mapply(function(x, meanlog, sdlog, ...) #
2008 Jul 17
0
How to compute loglikelihood of Lognormal distribution
Hi, I am trying to learn lognormal mixture models with EM. I was wondering how does one compute the log likelihood. The current implementation I have is as follows, which perform really bad in learning the mixture models. __BEGIN__ # compute probably density of lognormal. dens <- function(lambda, theta, k){ temp<-NULL meanl=theta[1:k] sdl=theta[(k+1):(2*k)]
2008 Feb 15
0
Poisson-lognormal probability calculations
Hi, just for the record, although I don't think it's relevant (!) ------------------------------------- > sessionInfo() R version 2.6.0 (2007-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats4 splines
2007 Sep 07
1
How to obtain parameters of a mixture model of two lognormal distributions
Dear List, I have read that a lognormal mixture model having a pdf of the form f(x)=w1*f1(x)+(1-w1)*f2(x) fits most data sets quite well, where f1 and f2 are lognormal distributions. Any pointers on how to create a function that would produce the 5 parameters of f(x) would be greatly appreciated. > version _ platform i386-pc-mingw32 arch i386 os
2002 Dec 10
1
Lognormal distribution
I am trying to fit a lognormal distribution to a set of data and test its goodness of fit with regard to predicted values. I managed to get so far: > y <- c(2,6,2,3,6,7,6,10,11,6,12,9,15,11,15,8,9,12,6,5) > library(MASS) > fitdistr(y,"lognormal",start=list(meanlog=0.1,sdlog=0.1)) meanlog sdlog 1.94810515 0.57091032 (0.12765945) (0.09034437) But I would
2002 Jul 12
1
Minor bug in dlnorm (PR#1781)
The density of a lognormal should be 0 for negative arguments, but > dlnorm(-1) [1] NaN Warning message: NaNs produced in: dlnorm(x, meanlog, sdlog, log) A simple fix is to change dlnorm's definition to: function (x, meanlog = 0, sdlog = 1, log = FALSE) .Internal(dlnorm(x*(x>0), meanlog, sdlog, log)) It might be faster to put the same sort of adjustment into the internal code, but
2003 Apr 09
3
plotting the lognormal density curve
I am trying to plot a lognormal density curve on top of an existing histogram. Can anybody suggest a simple way to do this? Even if someone could just explain how to plot a regular normal density curve on top of an existing histogram, it would be a big help. Also, is there some way to search through the R-help archives other than simple browsing? Thank you so much. Your help and time is greatly
2012 Aug 31
3
fitting lognormal censored data
Hi , I am trying to get some estimator based on lognormal distribution when we have left,interval, and right censored data. Since, there is now avalible pakage in R can help me in this, I had to write my own code using Newton Raphson method which requires first and second derivative of log likelihood but my problem after runing the code is the estimators were too high. with this email ,I provide
2008 Nov 14
0
Error in optim when i call it from a function
Dear R-users I've got the next problem: I've got this *function*: fitcond=function(x,densfun,pcorte,start,...){ myfn <- function(parm,x,pcorte,...) -sum(log(dens(parm,x,pcorte,...))) Call <- match.call(expand.dots = TRUE) if (missing(start)) start <- NULL dots <- names(list(...)) dots <- dots[!is.element(dots, c("upper",
2005 Jun 29
2
MLE with optim
Hello, I tried to fit a lognormal distribution by using optim. But sadly the output seems to be incorrect. Who can tell me where the "bug" is? test = rlnorm(100,5,3) logL = function(parm, x,...) -sum(log(dlnorm(x,parm,...))) start = list(meanlog=5, sdlog=3) optim(start,logL,x=test)$par Carsten. [[alternative HTML version deleted]]
2005 Mar 12
1
MLE for two random variables
Hello, I've the following setting: (1) Data from a source without truncation (x) (2) Data from an other source with left-truncation at threshold u (xu) I have to fit a model on these these two sources, thereby I assume that both are "drawn" from the same distribution (eg lognormal). In a MLE I would sum the densities and maximize. The R-Function could be:
2010 Jan 12
1
Strange behavior when trying to piggyback off of "fitdistr"
Hello. I am not certain even how to search the archives for this particular question, so if there is an obvious answer, please smack me with a large halibut and send me to the URLs. I have been experimenting with fitting curves by using both maximum likelihood and maximum spacing estimation techniques. Originally, I have been writing distribution-specific functions in 'R' which work
2009 May 29
1
Mean of lognormal in base-2
Hi, Does anyone know what the mean value of a lognormal distribution in base-2 is? I am simulating stochastic population growth and if I were working in base-e, I would do:lambda <- 1.1 #multiplicative growth rates <- 0.6 #stochasticity (std. dev)lognormal <- rlnorm(100000, log(lambda) - (s^2)/2, s)## or lognormal <- exp( rnorm( 100000, log(lambda) - (s^2)/2,
2006 Aug 05
1
AIC for lognormal model
Dear all, I want to compare some different models for a dataset by QQ plots and AIC. I get the following AICs: - linear model: 19759.66 - GAMLSS model: 18702.7 - linear model with lognormal response: -7862.182 The QQ plots show that the lognormal model fits better than the linear model, but still much worse than the GAMLSS. So, in my opinion, the AIC of the lognormal model should be between the
2004 Mar 02
2
Problem with Integrate
The background: I'm trying to fit a Poisson-lognormal distrbutuion to some data. This is a way of modelling species abundances: N ~ Pois(lam) log(lam) ~ N(mu, sigma2) The number of individuals are Poisson distributed with an abundance drawn from a log-normal distrbution. To fit this to data, I need to integrate out lam. In principle, I can do it this way: PLN1 <- function(lam, Count,
2011 Nov 01
1
low sigma in lognormal fit of gamlss
Hi, I'm playing around with gamlss and don't entirely understand the sigma result from an attempted lognormal fit. In the example below, I've created lognormal data with mu=10 and sigma=2. When I try a gamlss fit, I get an estimated mu=9.947 and sigma=0.69 The mu estimate seems in the ballpark, but sigma is very low. I get similar results on repeated trials and with Normal and
2012 Aug 29
2
Estimation parameters of lognormal censored data
Hi, I am trying to get the maximum likelihood estimator for lognormal distribution with censored data;when we have left, interval and right censord. I built my code in R, by writing the deriving of log likelihood function and using newton raphson method but my estimators were too high " overestimation", where the values exceed the 1000 in some runing of my code. is there any one can
2007 Mar 23
1
generating lognormal variables with given correlation
Dear R users I use simulated data to evaluate a model by sampling the parameters in my model from lognormal distributions. I would like these (lognormal distributed) parameters to be correlated, that is, I would like to have pairwise samples of 2 parameters with a given correlation coefficient. I have seen that a covariance matrix can be fixed when generating random variables from a