Hi Jonas,

I'm afraid we need more detail.

On Mon, Feb 13, 2012 at 5:54 PM, Jonas Stein <n...@jonasstein.de> wrote:
> I want to fit discrete data that was measured on a wavegenerator.
> In this minimal example i generate some artificial data:
>
> testsin <- 2+ 5 * sin(1:100) #generate sin data
> testsin <-  testsin+ rnorm(length(testsin), sd = 0.01) #add noise
>
> mydata <- list(X=1:100, Y=testsin) # generate mydata object
>
> nlmod <- nls(X ~ A+B*sin(C* Y), data=mydata, start=list(A=2, B=4, C=1), 
> trace=TRUE)
>
> # this nls fit fails.
>

Fails how? It runs when I copy and paste your code into a terminal, given:
> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C                 LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

What happens when you run it? What do you expect to happen?
What's your sessionInfo()?

"fails" doesn't convey enough information here.

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to