Displaying 2 results from an estimated 2 matches for "my_seq".
2009 Jul 20
3
Histograms on a log scale
Dear All,
I would like to be able to plot histograms/densities on a semi-log or
log-log scale.
I found several suggestions online
http://tolstoy.newcastle.edu.au/R/help/05/09/12044.html
https://stat.ethz.ch/pipermail/r-help/2002-June/022295.html
http://www.harding.edu/fmccown/R/#histograms
Now, consider the code snippet taken from
http://www.harding.edu/fmccown/R/#histograms
# Get a random
2009 Aug 07
0
Fitting Truncated Distribution
...re are any observations ruled out by a threshold).
(1) Consider the following snippet (along the lines of the suggestion in
the link above)
rm(list=ls())
library(MASS)
set.seed(1234)
lt_lognormal <- function(x, meanlog, sdlog ){
dlnorm(x, meanlog , sdlog )/plnorm(0.5, meanlog , sdlog )
}
my_seq <- rlnorm(10000)
my_fit <- fitdistr(my_seq,"lognormal")
cut_low <- my_seq[which(my_seq>0.5)]
my_fit_low <- fitdistr(cut_low,lt_lognormal,list(meanlog=0.2,sdlog=0.7),
lower=0.5 )
However, when I run it I get the following error
Error in optim(x = c(1.31973273433717, 2....