[R] help with estimating parameters with nls
Uri Iskin
uiskin at udesa.edu.ar
Tue Sep 20 20:44:07 CEST 2005
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
More information about the R-help
mailing list