[R] help with estimating parameters with nls

Francisco J. Zagmutt gerifalte28 at hotmail.com
Wed Sep 21 06:59:27 CEST 2005


RSiteSearch("Dagum")

Francisco


>From: "Uri Iskin" <uiskin at udesa.edu.ar>
>To: <r-help at stat.math.ethz.ch>
>Subject: [R] help with estimating parameters with nls
>Date: Tue, 20 Sep 2005 15:44:07 -0300
>
>Dear helpeRs,
>
>I have a vector containing values of incomes and I would like to estimate
>the three parameters of a Dagum distribution.
>Dagum himself recommends to use nonlinear least-squares method.
>I have read nls, optim (and the posting guide!) and still have not 
>succeded.
>
>sipcf is my sorted vector of incomes with 3065 obs.
>fda is a vector of the empirical cumulative distribution probabilities:
> > fda <- vector(length=length(sipcf))
> > for (I in 1:length(sipcf)){
> > fda[i] <- sum(sipcf <= sipcf[i])/length(sipcf)
> > }
>fdae is the cdf:
> > fdae <- function(x){
> > fda[sum(sipcf<=x)]
>}
>dagfda is the cdf of Dagum:
> > dagfda <- function(x,a,b,p){
>(1+(x^(-a)*b^a))^(-p)
>}
>
>start values I am using: a=1.9 b=0.34 p=1.3
>
>I am trying to get the parameters estimates with nls and optim, but all I
>get are errors.
>Could you help me showing how to get them?
>Thank you in advance!
>
>Uri Iskin
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! 
>http://www.R-project.org/posting-guide.html




More information about the R-help mailing list