Displaying 20 results from an estimated 2000 matches similar to: "Fitdistr() versus nls()"
2007 Apr 11
3
Help with pexp( )
Dear all,
Sorry for bringing up an old issue:
>pexp(50, 0.5)
[1] 1
In some cases, pexp() gives CDF=1. I read some discussion in 2002 saying it
has been patched. However it's not working in "R2.4.1Patched". Could anyone
help me out?
Thanks a lot,
Jeann
_________________________________________________________________
Fine Dining & Fancy Food. Check Out This
2011 Aug 22
1
d, p, q, r - What are the math relations with each other of this functions?
Hi all,
Using the exponential distribution to exemplify: The dexp function is
the PDF (1) and pexp is the CDF (2), that is obtained integrating the
PDF. How can I get the qexp and the rexp? Considering that I have the
PDF, how this two are mathematically related to the PDF?
(1) ke^{-kx}
(2) 1-e^{kx}
Thanks in advance.
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
2006 Feb 03
2
Problems with ks.test
Hi everybody,
while performing ks.test for a standard exponential distribution on samples
of dimension 2500, generated everytime as new, i had this strange behaviour:
>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)
One-sample Kolmogorov-Smirnov test
data: data
D = 0.0147, p-value = 0.6549
alternative hypothesis: two.sided
>data<-rexp(2500,0.4)
2003 Sep 23
1
AW: Rank and extract data from a series
Hi,
>I would like to rank a time-series of data, extract the top ten data items from this series, determine the
>corresponding row numbers for each value in the sample, and take a mean of these *row numbers* (not the data).
>I would like to do this in R, rather than pre-process the data on the UNIX command line if possible, as I need to >calculate other statistics for the series.
2011 Nov 22
4
evaluation question
Dear R People:
Hope you're having a nice day.
Here is a character vector:
> yz
[1] "pexp(3.2,rate=1)"
> str(yz)
chr "pexp(3.2,rate=1)"
>
And I would like to evaluate that vector.
I tried:
> eval(as.expression(yz))
[1] "pexp(3.2,rate=1)"
>
But that doesn't work.
Any suggestions would be most welcome. I have a feeling that it's
quite
2008 Sep 19
0
Re lative Novice ? "Can I get some explanation of the docs for fitdistr(MASS)?"
In the docs I see:
Usage
fitdistr(x, densfun, start, ...)
Arguments
x A numeric vector.
densfun Either a character string or a function returning a density
evaluated at its first argument.
Distributions "beta", "cauchy", "chi-squared", "exponential", "f", "gamma",
"geometric", "log-normal", "lognormal",
2004 Feb 17
2
problem with fitdistr ?
Hi,
I'm trying fitdistr but I'm getting some errors
> fitdistr(rnorm(100),"Normal")
Error in fitdistr(rnorm(100), "Normal") : 'start' must be a named list
> fitdistr(rnorm(100),"Normal",start=list(mean=0,sd=1))
Error in fitdistr(rnorm(100), "Normal", start = list(mean = 0, sd = 1))
:
supplying pars for the Normal is not
2012 Jul 02
1
Fitting and Plotting the fitted distributions
Dear all,
I have wrote some sample code that would allow me easier fit fast many distributions and check which of the fits performs better. My sample code (that you can of course execute it looks like that)
distrList<-list( "exponential", "geometric", "log-normal", "normal",
"Poisson")
fitfunction<-function(Type,x){
return
2008 Sep 22
0
Warnings in fitdistr() from MASS.
For a lark, I experimented a bit with the data from Ted Byers' recent
postings. The result of fitdistr() seemed sensible, but I was bothered
by the warnings about NaNs that arose. Warnings always make me nervous.
Explicitly this is what I did:
TXT <- "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2008 Sep 22
0
Re lative novice: Working with fitdistr(MASS): 3 questions
OK, I am now at the point where I can use fitdistr to obtain a fit of one of
the standard distributions to mydata.
It is quite remarkable how different the parameters are for different
samples through from the same system. Clearly the system itself is not
stationary.
Anyway, question 1: I require a visual perspective of the fit I get. I can
use hist.scott to get a hisogram (and just have to
2007 Sep 09
1
fitdistr()
I am trying to fit the chi-squared distribution to a set of data using the fitdistr function found in the MASS4 library, the data set is called ONES3, I have loaded it using the command
ONES3<-read.table("ONES3.pdf",header=TRUE,na="NA")
I print out the dataset ONES3 to the screen to make sure it has loaded
Then I try to fit this data using the command
2003 Jul 04
1
Problem with fitdistr for beta
I have the following problem:
I have a vector x of data (0<x<=1 ) with
a U-shaped histogram and try to fit a beta
distribution using fitdistr. In fact,
hist(rbeta(100,0.1,0.1)) looks a lot like
my data.
The equivalent to
the example in the manual
sometimes work:
> a <- rbeta(100,0.1,0.1)
> fitdistr(x=a, "beta", start=list(shape1=0.1,shape2=0.1))1)
> shape1
2013 Oct 28
0
"Optimization fail" error from fitdistr (Weibull distribution)
Hello everyone,
This is Kangmin.
I am trying to produce shape and scale of my wind data. My data is based on
wind speed frequency with 1km/hr increment. data is described below.
Windspeed (km/h) Frequency
1 351
2 147
3 317
4 378
5 527
6 667
7 865
8 970
9 987
10 907
11 905
12 642
13 1000
14 983
15 847
16 842
17 757
18 698
19 632
20 626
21 599
22 529
23 325
24 391
2003 Jul 28
1
Optimization failed in fitting mixture 3-parameter Weibull distri bution using fitdistr()
Dear All;
I tried to use fitdistr() in the MASS library to fit a mixture
distribution of the 3-parameter Weibull, but the optimization failed.
Looking at the source code, it seems to indicate the error occurs at
if (res$convergence > 0)
stop("optimization failed").
The procedures I tested are as following:
>w3den <- function(x, a,b,c)
2011 May 03
3
fitting distributions using fitdistr (MASS)
Please guide me through to resolve the error message that I get
this is what i have done.
>x1<- rnorm(100,2,1)
>x1fitbeta<-fitdistr(x1,"beta")
Error in fitdistr(x1, "beta") : 'start' must be a named list
Yes, I do understand that sometime for the distribution to converge to the
given set of data, it requires initial parameters of the distribution, to
2003 Nov 27
2
MASS fitdistr()
Dear R experts,
I am trying to use the R MASS library fitdistr() to fit the following
list:
k21stsList<-c(0.76697,0.57642,0.75938,0.82616,0.93706,0.77377,0.58923,0.37157,0.60796,1.00070,0.97529,0.62858,0.63504,0.68697,0.61714,0.75227,1.16390,0.66702,0.83578)
as follows,
library(MASS)
fitdistr(k21stsList, "normal")
But, I get
Error in fitdistr(k21stsList, "normal") :
2008 Feb 09
2
print.fitdistr buglet
Dear developers,
There's a small bug in print.fitdistr that can cause output to be printed
twice, but only if print is called explicitly:
> fit<-fitdistr(rt(1000,3),"t")
There were 11 warnings (use warnings() to see them)
> fit
m s df
-0.02181723 1.00145296 3.13723878
( 0.03865057) ( 0.03999447) ( 0.33298377)
> print(fit)
2008 Oct 30
1
Is possible, on biological grounds, suggest to fitdistr (MASS library) that the estimated parameters must be between two values?
Sorry if it is a silly question, I haven't found documentation on this and I
don't know if it is possible.
library(MASS) ## for fitdistr
library(msm) ## for dtnorm
#prepare truncated normal distribution
dtnorm0 <- function(x, mean, sd , log = FALSE) {
dtnorm(x, mean, sd, 105, 135, log)
}
set.seed(1)
#Generate normal distribution with the TRUE population mean (day 106 of the
2010 Jan 28
4
Problems with fitdistr
Hi,
I want to estimate parameters of weibull distribution. For this, I am using
fitdistr() function in MASS package.But when I give fitdistr(c,"weibull") I
get a Error as follows:-
Error in optim(x = c(4L, 41L, 20L, 6L, 12L, 6L, 7L, 13L, 2L, 8L, 22L,
:
non-finite value supplied by optim
Any help or suggestions are most welcomed
--
View this message in context: