Displaying 20 results from an estimated 700 matches similar to: "Bug in truncgof package?"
2009 May 31
1
Bug in truncgof package?
Dear R-helpers,
I was testing the truncgof CRAN package, found something that looked
like a bug, and did my job: contacted the maintainer. But he did not
reply, so I am resending my query here.
I installed package truncgof and run the example for function ad.test. I
got the following output:
set.seed(123)
treshold <- 10
xc <- rlnorm(100, 2, 2) # complete sample
xt <- xc[xc >=
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,
2009 Aug 07
0
Fitting Truncated Distribution
Dear All,
I know that this topic has been already discussed on this list (see e.g.
http://markmail.org/message/bq2bdxwblwl4rpgf?q=r+fit+truncated+lognormal&page=1&refer=2ufc4fb2eftfwwml#query:r%20fit%20truncated%20lognormal+page:1+mid:7wxgkdxhixotorr5+state:results
for the case of weibull distribution), but I am experiencing some problems.
I deal with truncated distributions (that this to
2014 Oct 15
2
Test K-S con distribuciones LogNormales
Hola Ruben,
Sí precisamente es lo que comentas, en matemáticas no se suele llamar
bucketización (este término se emplea más en informática) sino datos
agrupados. Pero la idea es la que tu mismo dices.
Respecto a las gráficas que has puesto, me han aclarado mucho sobre el
tema, gracias.
Si realizo lo mismo, por ejemplo con nbucket=1000 sigo obteniendo un
p-valor de 1. Es decir, que casi le
2003 Aug 28
2
ks.test()
Dear All
I am trying to replicate a numerical application (not computed on R) from an
article. Using, ks.test() I computed the exact D value shown in the article
but the p-values I obtain are quite different from the one shown in the
article.
The tests are performed on a sample of 37 values (please see "[0] DATA"
below) for truncated Exponential, Pareto and truncated LogNormal
2013 Jun 28
0
"actuar" package query
I run the following:
library(actuar)
x <- seq(0, 22, 0.5)
fl <- discretize(plnorm(x, 2.1), from = 0, to = 22, step = 0.5, method
="lower")
Fs <- aggregateDist("recursive", model.freq = "poisson",model.sev = fl,
lambda = 10, x.scale = 0.5)
Warning message:
In panjer(fx = model.sev, dist = dist, p0 = p0, x.scale = x.scale, :
maximum number of recursions
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,
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 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
2008 May 04
1
Is my understanding of rlnorm correct?
rlnorm takes two 'shaping' parameters: meanlog and sdlog.
meanlog would appear from the documentation to be the log of the mean.
eg if the desired mean is 1 then meanlog=0.
So to generate random values that fit a lognormal distribution I would
do this:
rlnorm(N , meanlog = log(mean) , sdlog = log(sd))
But when I check the mean I don't get it when sdlog>0. Interestingly I
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",
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
2011 Jul 30
2
NAN problem
Hi All,
Did anyone else have a problem like this? I am sorry if its a small issue, I
seem to not understand what to do to get rid of this error.
> Sigma
[1] 0.1939025
> MuRest
[1] 8.512772
> TauZero
[1] 0.1
> curve(qlnorm(x,-TauZero+MuRest, Sigma,lower.tail=F), xlim=c(4000,9000),
ylim=c(0,.99),xlab="", ylab="")
Warning message:
In qlnorm(p, meanlog, sdlog,
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
2012 Oct 14
0
multivariate lognormal distribution simulation in compositions
Dear All,
thanks to Berend, my question posted yesturday was solved succesfully here: http://r.789695.n4.nabble.com/hep-on-arithmetic-covariance-conversion-to-log-covariance-td4646068.html . I posted the question with the assumption of using the results with rlnorm.rplus() from compositions. Unfortunatelly, I am not getting reasonable enough outcome. Am I applying the results wrongfully? The
2010 Jul 13
1
Batch file export
Dear all,
I have a code that generates data vectors within R. For example assume:
z <- rlnorm(1000, meanlog = 0, sdlog = 1)
Every time a vector has been generated I would like to export it into a csv
file. So my idea is something as follows:
for (i in 1:100) {
z <- rlnorm(1000, meanlog = 0, sdlog = 1)
write.csv(z, "c:/z_i.csv")
Where "z_i.csv" is a filename that is
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
2007 Feb 14
0
How to use Rpad
I am a beginner and I don't know how to use Rpad package.
I installed it and opened the following example .Rpad page in Internet
Explorer.
When I clicked "Calculate" button, nothing seems to happen. Can anyone tell
me how to use Rpad?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<!-- by Tom Short, EPRI, tshort at epri.com
(c) Copyright 2005 by
2013 May 10
1
rlnorm(n, meanlog = 0, sdlog = 1)
Hi list,
Does anyone know the code behind rlnorm(n, meanlog = 0, sdlog = 1)? I am
going to write it in c#.
thanks
Alireza
[[alternative HTML version deleted]]
2007 Oct 15
0
help with simple goodness of fit test
Hello,
I've read the other posts with regard to "chisq.test" and "goodness of fit"
and am still missing something.
1. I create a simple vector of randomly generated lognormal values with
mean=0 and sd=1;
>d1 <- rlnorm(100,meanlog=0,sdlog=1);
2. I also create a vector of probabilities that are expected for a lognormal
distribution. I suspect this is the culprit.
>pr