[R] ecdf() to nls() - how to transform data?

Jochen1980 info at jochen-bauer.net
Sat Jul 16 14:17:26 CEST 2011

```Hi,

I am using ecdf-function and want to use the ecdf()-data-points for nls() as
data-parameter.
nls() expects 'list' or 'environment' as a data-type, knots(ecdf(mydata))
gives me 'numeric'.
What should I do now?

Here is the code:
#################################################
# --- Fit ---
# Gumbel-Dist-Function, cumulative,
http://en.wikipedia.org/wiki/Gumbel_distribution
#               ( - ( x - mue ) / beta )
#          ( -e )^
# F(x) = e^
# formula for fitting-function
# formula: y ~ I( exp(1) ^ ( - exp(1) ) ^ ( - ( x - mue ) / beta ) )
# data: ecdf( hgd\$V1 )
# start: list( mue=0.1, beta=0.025 )
gpfunction <- ecdf( hgd\$V1 )
gplistrange <- seq( 0.0, 1, by=0.001 )
gplist <- gpfunction( gplistrange )
print( gplist )
print( class( gplist ) )
print("---")
#res <- nls( y ~ I( exp(1) ^ ( - exp(1) ) ^ ( - ( x - mue ) / beta ) ), df,
list( mue=0.1, beta=0.025 ), trace=TRUE )
#print( summary( res ) )

--
View this message in context: http://r.789695.n4.nabble.com/ecdf-to-nls-how-to-transform-data-tp3671754p3671754.html
Sent from the R help mailing list archive at Nabble.com.

```