search for: lnorm

Displaying 7 results from an estimated 7 matches for "lnorm".

Did you mean: rnorm
2011 Sep 21
2
problem with function "Truncate" in package "distr"
...llo all, Can someone tell me why the following mixture of two log-normal distributions does not get truncated? What puzzles me is that the function works almost always, but for certain combinations (like the one below), it does not. # R code example library(distr) mix<-UnivarMixingDistribution(Lnorm(3.2,0.5),Lnorm(5.4,0.6),mixCoeff=c(0.3,0.7)) mix.trunc<-Truncate(mix,lower=0.001,upper=3000) distr.sample<-r(mix.trunc)(1000000) range(distr.sample) Why do I get values over 3000 (which was the defoned upper limit)? Some help would be greatly appreciated. Duarte Viana
2011 Oct 06
1
apply and functions with many arguments
Dear all, I would like to use the following function fitdist(data, distr, method=c("mle", "mme", "qme", "mge"), start=NULL, fix.arg=NULL, ...) for many different distr values like distr=c("norm","lnorm","pois") (just a small example) and take back into a list the parameter name which is what is inside distr plus what the function fitdist returns (another list). How can I do that ?  B.R Alex [[alternative HTML version deleted]]
2018 Feb 16
0
Competing risks - calibration curve
...low #install.packages("rms") require(rms) #install.packages("mstate") library(mstate) require(splines) library(ggplot2) library(survival) library(splines) #install.packages("survsim") require(survsim) set.seed(10) df<-crisk.sim(n=500, foltime=10, dist.ev=rep("lnorm",2), anc.ev=c(1.48,0.53),beta0.ev = c(3.80,2.54), dist.cens = "lnorm", anc.cens = 3.5, beta0.cens = 5.42, z=NULL, beta = list(c(0.21, 0.017), c(0.37, 0.016)), x=list(c("normal",0,1), c("bern",0.564)), nsit=2) table(status) table(cause) df$cause<-ifelse(is.na(...
2010 Jan 12
1
Strange behavior when trying to piggyback off of "fitdistr"
...e function passed to optim. What is weird is when I leave out the density correction (which is safe 99.9999% of the time as the chances of two identical losses is almost 0 (assuming no clustering/capping) ), I get a very similar result to my distribution-customized function which calls the proper plnorm or pgenpareto directly. When I add in the correction, the value is orders of magnitude higher, which not only affects the fit (slightly) but also affects the goodness of fit statistics. I have no idea why this happens, although in theory, if the function is pulling too many density values, it would...
2014 Jun 11
0
infelicity in dlnorm, plnorm
In theory, dlnorm(x, ...) == dnorm(log(x), ...)/x, x>0. Unfortunately, when sd=0, dlnorm and plnorm return NaN, while dnorm returns (if(x != mean)0 else Inf) and pnorm returns (if(x<mean)0 else 1). [A numerical optimization, maxLik{maxLik}, reported the NaNs for me.] help('dlnorm') says, "dl...
2005 Jul 21
1
About object of class mle returned by user defined functions
...d "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 standing for one of the R densities, eg, "gamma", "lnorm", etc. That's the density the user wants to fit to the data. 3) A named list with initial values for the density parameters; that will be passed to optim via mle. 4) The method to be used by optim via mle. That can be change by the code if parameter boundaries are also supplied. 5) The l...
2011 Mar 15
3
fitting a distribution to a ecdf plot
Dear all, I need to plot an cumulative distribution plot of a variable and then to fit a distribution to that, probably a weibull or lognormal. I have plotted the ecdf as > plot(ecdf(x)) but I haven't managed to fit the distribution. I have as well attached the data. I would appreciate if you could help me on that. Thank you. Kind regards Maria -------------- next part --------------