Re: [R] Curve fitting

2020-04-05 Thread J C Nash
Generally nlsr package has better reliability in getting parameter estimates because it tries to use automatic derivatives rather than a rather poor numerical estimate, and also uses a Levenberg-Marquardt stabilization of the linearized model. However, nls() can sometimes be a bit more flexible.

Re: [R] Curve fitting

2020-04-05 Thread Bernard Comcast
Thanks Jeff Bernard Sent from my iPhone so please excuse the spelling!" > On Apr 5, 2020, at 3:14 PM, Jeff Newmiller wrote: > > stats::nlm? > >> On April 5, 2020 11:53:10 AM PDT, Bernard Comcast >> wrote: >> Any recommendations on an R package to fit data to a nonlinear model >> Y=f(x) with

Re: [R] Curve fitting

2020-04-05 Thread Jeff Newmiller
err... stats::nls... On April 5, 2020 12:14:15 PM PDT, Jeff Newmiller wrote: >stats::nlm? > >On April 5, 2020 11:53:10 AM PDT, Bernard Comcast > wrote: >>Any recommendations on an R package to fit data to a nonlinear model >>Y=f(x) with a single x and y variable? >> >>I want to be able to gener

Re: [R] Curve fitting

2020-04-05 Thread Jeff Newmiller
stats::nlm? On April 5, 2020 11:53:10 AM PDT, Bernard Comcast wrote: >Any recommendations on an R package to fit data to a nonlinear model >Y=f(x) with a single x and y variable? > >I want to be able to generate parameter uncertainty estimates and >prediction uncertainties if possible. > >Berna

Re: [R] curve fitting an exponential function

2012-10-08 Thread giuseppe calamita
Hi Waltenegus, you should consider to show us your code and the data you used to fit the curve. If you can't or if you prefer you can simply show the code and some sample data on which the code can be run. You'll find nice and useful tool in nlstools package. Hope this help Giuseppe - Gius

Re: [R] Curve fitting, probably splines

2012-04-16 Thread Simon Wood
You could use the summation convention built into mgcv:gam for this. See ?linear.functional.terms for details, but here is some example code, both for the exact match, you describe, and a noisy version. best, Simon library(mgcv) f2 <- function(x) 0.2*x^11*(10*(1-x))^6+10*(10*x)^3*(1-x)^10 ## te

Re: [R] Curve fitting, probably splines

2012-04-13 Thread Greg Snow
This sounds like possibly using logsplines may be what you want. See the 'oldlogspline' function in the 'logspline' package. On Thu, Apr 12, 2012 at 7:45 AM, Michael Haenlein wrote: > Dear all, > > This is probably more related to statistics than to [R] but I hope someone > can give me an idea h

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-05-02 Thread Kyeong Soo (Joseph) Kim
ovided some technical and practical information which I could learn >> from and be very thankful for. >> >> Regards, >> Joseph >> >> On Fri, Apr 30, 2010 at 11:35 PM, Greg Snow >> wrote: >> > >> >> -Original Message----- >>

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Greg Snow
nal Message- > From: Kyeong Soo (Joseph) Kim [mailto:kyeongsoo@gmail.com] > Sent: Friday, April 30, 2010 5:24 PM > To: Greg Snow > Cc: r-help@r-project.org > Subject: Re: [R] Curve Fitting/Regression with Multiple Observations > > I have already learned a lot from the

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
lto:r-help-boun...@r- >> project.org] On Behalf Of Kyeong Soo (Joseph) Kim >> Sent: Friday, April 30, 2010 4:10 AM >> To: kMan >> Cc: r-help@r-project.org >> Subject: Re: [R] Curve Fitting/Regression with Multiple Observations > > [snip] > >> By the way, I won

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Kyeong Soo (Joseph) Kim > Sent: Friday, April 30, 2010 4:10 AM > To: kMan > Cc: r-help@r-project.org > Subject: Re: [R] Curve Fitting/Regression with

Re: [R] Curve Fitting

2010-04-30 Thread Gabor Grothendieck
You can use nls2 to try many starting values. It works just like nls but: - if you give it a two row data frame as the start value it will create a grid between the upper and lower values of each parameter and then run an optimization starting at each such point on the grid returning the best - i

Re: [R] Curve Fitting

2010-04-30 Thread apjaworski
Thomas, I think the issue of having reasonable starting values is inherent in all nonlinear optimization problems (unless they have some additional properties like convexity, for example). Using a different algorithm may or may not help. In fact, a vast majority of existing algorithms guaran

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
gsoo@gmail.com] > Sent: Friday, April 30, 2010 4:10 AM > To: kMan > Cc: r-help@r-project.org > Subject: Re: [R] Curve Fitting/Regression with Multiple Observations > > Dear Keith, > > Thanks for the suggestion and taking your time to respond to it. > > But, you misunde

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
n wrote: >> > Dear Joseph, >> > >> > If you do not need to make any inferences, that is, you >> just want it to look pretty, then drawing a curve by hand is >> as good a solution as any. Plus, there is no reason for >> expert testimony to say that the cu

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread kMan
eithC. -Original Message- From: Kyeong Soo (Joseph) Kim [mailto:kyeongsoo@gmail.com] Sent: Friday, April 30, 2010 4:10 AM To: kMan Cc: r-help@r-project.org Subject: Re: [R] Curve Fitting/Regression with Multiple Observations Dear Keith, Thanks for the suggestion and taking your time to re

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Liaw, Andy
rve does not mean anything. > > > > Sincerely, > > KeithC. > > > > -Original Message- > > From: Kyeong Soo (Joseph) Kim [mailto:kyeongsoo@gmail.com] > > Sent: Tuesday, April 27, 2010 2:33 PM > > To: Gabor Grothendieck > > Cc: r

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
m: Kyeong Soo (Joseph) Kim [mailto:kyeongsoo@gmail.com] > Sent: Tuesday, April 27, 2010 2:33 PM > To: Gabor Grothendieck > Cc: r-help@r-project.org > Subject: Re: [R] Curve Fitting/Regression with Multiple Observations > > Frankly speaking, I am not looking for such a framework. >

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-29 Thread kMan
- From: Kyeong Soo (Joseph) Kim [mailto:kyeongsoo@gmail.com] Sent: Tuesday, April 27, 2010 2:33 PM To: Gabor Grothendieck Cc: r-help@r-project.org Subject: Re: [R] Curve Fitting/Regression with Multiple Observations Frankly speaking, I am not looking for such a framework. The system I&#

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-27 Thread Kyeong Soo (Joseph) Kim
Frankly speaking, I am not looking for such a framework. The system I'm studying is a communication network (like M/M/1 queue, but way too complicated to mathematically analyze it using classical queueing theory) and the conclusion I want to make is qualitative rather than quantatitive -- a high-l

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-27 Thread Gabor Grothendieck
If you are looking for a framework for statistical inference you could look at additive models as in the mgcv package which has a book associated with it if you need more info. e.g. library(mgcv) fm <- gam(dist ~ s(speed), data = cars) summary(fm) plot(dist ~ speed, cars, pch = 20) fm.ci <- with(

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-27 Thread Kyeong Soo (Joseph) Kim
Hello Gabor, Many thanks for providing actual examples for the problem! In fact I know how to apply and generate plots using various R functions including loess, lowess, and smooth.spline procedures. My question, however, is whether applying those procedures directly on the data with multiple ob

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-27 Thread Gabor Grothendieck
This will compute a loess curve and plot it: example(loess) plot(dist ~ speed, cars, pch = 20) lines(cars$speed, fitted(cars.lo)) Also this directly plots it but does not give you the values of the curve separately: library(lattice) xyplot(dist ~ speed, cars, type = c("p", "smooth")) On Tue,

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-27 Thread Bert Gunter
Joseph: I believe you need to stop inventing your own statistical methods and consult a professional statistician. I do not think this list is the proper place to look for a statistics tutorial when your statistical background appears to be so inadequate for the task. Sorry to be so direct -- per

Re: [R] curve fitting to data

2009-12-04 Thread Peter Ehlers
Pascale, If you do want an nls fit with the associated error structure assumptions, check ?SSlogis. fm <- nls(y ~ SSlogis(x, Asy, xmid, scal)) summary(fm) xx <- seq(123, 248, length = 101) yy <- predict(fm, list(x = xx)) plot(x, y) lines(xx, yy) -Peter Ehlers Gabor Grothendieck wrote:

Re: [R] curve fitting to data

2009-12-04 Thread Gabor Grothendieck
A simple y vs log(x) fit seems to work pretty well here: fit <- lm(y ~ log(x)) summary(fit) plot(y ~ log(x)) abline(fit) On Fri, Dec 4, 2009 at 9:06 AM, Pascale Weber wrote: > Hi to all > > This is the first time I am quoting a question and I hope, my question is > not too basic... > > For the

Re: [R] curve fitting

2009-05-12 Thread Katharine Mullen
or use nls.lm as in install.packages("minpack.lm") library(minpack.lm) x <- c(2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74) y <- c(100, 99, 99, 98, 97, 94, 82, 66, 48, 38, 22, 10, 1) res <- function(p, x, y) y - ff(p,x) ff <- function(p, x) 100*exp(p[1]*(1-exp(p[2]*x))/p[2]) aa <- nls.lm(par

Re: [R] curve fitting

2009-05-12 Thread Jorge Ivan Velez
Dear Dmitry, Take a look at ?nls and its examples. HTH, Jorge On Tue, May 12, 2009 at 5:44 PM, Dmitry Gospodaryov wrote: > I have the data: > for x: 2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, > for y: 100, 99, 99, 98, 97, 94, 82, 66, 48, 38, 22, 10, 1. > y depends on x by equation: y =

Re: [R] Curve fitting,FDA for biological data

2009-04-13 Thread trias
Hi Thanks a lot, I think you have covered the things I want to do for now so I will try to implement them as soon I can. << A finite Fourier series could be the best tool IF the the multiple periodicities are all integer fractions of a common scale.>> This is certainly true for my repetitive

Re: [R] Curve fitting,FDA for biological data

2009-04-11 Thread spencerg
Dear Dr Gkikopoulos: 1. Have you looked at "bioconductor.org"? They have substantive extensions to R specifically for "genomic data", which I assume would include chromosome. 2. To "identify periodicities at different timescales", I agree with Stephen that "spectrum" would l

Re: [R] Curve fitting,FDA for biological data

2009-04-06 Thread trias
There are a couple of different goals for this projects *identify periodicities at different timescales (ie different dT) *fit data into discrete number of curves, ie 6 different basic functions should be enough to describe the basic repeating elements in this data (ie 6 different categories of

Re: [R] Curve fitting,FDA for biological data

2009-04-03 Thread stephen sefick
What is your end goal? If it is to try and account for the variability of the "timeseries" you may want to look at ?spectrum If it is to model the periodicity... Stephen Sefick On Fri, Apr 3, 2009 at 11:30 AM, trias wrote: > > Here is the gif that didn't come through earlier > http://www.nabble

Re: [R] Curve fitting,FDA for biological data

2009-04-03 Thread trias
Here is the gif that didn't come through earlier http://www.nabble.com/file/p22870832/signal.gif signal.gif -- View this message in context: http://www.nabble.com/Curve-fitting%2CFDA-for-biological-data-tp22868069p22870832.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] curve fitting with given term

2009-01-13 Thread Ben Bolker
gregor rolshausen biologie.uni-freiburg.de> writes: > > ok. sorry for being blurry. > > I have x,y data, that probably fits a asymptotic curve (asymptote at N). > now I want to fit a curve onto the data, that gives me the N. therefore > I thought to fit an e-function, namely N(1-e^(y/x)) onto

Re: [R] curve fitting with given term

2009-01-13 Thread gregor rolshausen
ok. sorry for being blurry. I have x,y data, that probably fits a asymptotic curve (asymptote at N). now I want to fit a curve onto the data, that gives me the N. therefore I thought to fit an e-function, namely N(1-e^(y/x)) onto the data and get the N from the fitted curves' equation. in the

Re: [R] curve fitting with given term

2009-01-13 Thread Uwe Ligges
gregor rolshausen wrote: hello, I want to fit a curve to a simple x,y dataset - my problem is, that I want to fit it for the following term: n(1-e^x/y) - so I get the n constant for my data... Not an R problem in the first place, but the question arises what "n(1-e^x/y)" means, its is jus

Re: [R] curve fitting problem

2007-12-24 Thread Gabor Grothendieck
Your model is singular. Varying m and log(l) have the same effect: log(ir) = log(k) + m * log(l) * ox Also with plinear you don't specify the linear coefficients but rather an X matrix whose coefficients represent them: If we use this model instead: ir = k * exp(m * ox) Then: > mod0 <- lm(log(