Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:11:33+00:00 2026-05-24T00:11:33+00:00

I have a R / S / Nonlinear regression related issue and i am

  • 0

I have a R / S / Nonlinear regression related issue and i am not a R programmer, so i kinda need help.

I have two arrays – tt and td.

I need to find the parameters a,b and c so the sum of least squares is minimal for a non linear function:

td / tt - a * exp( b * tt ) + c 

I have no idea how to do this. I tried nls() function, nls2() nad had no luck…

Thanks in advance.

EDIT:

My data:

td <-as.array(0.2, 0.4, 0.8, 1.5, 3);

tt <-as.array(0.016, 0.036, 0.0777, 0.171, 0.294);

With the method from the answer below, i get ok values for random data, but the data i am using returns the Missing value or an infinity produced when evaluating the model message.

Sorry for not providing data sooner.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:11:34+00:00Added an answer on May 24, 2026 at 12:11 am

    Your data:

    n <- 100
    td <- runif(n)
    tt <- runif(n)
    data <- data.frame(td = td, tt = tt)
    

    A made up result of function

    a <- 0.5
    b <- 2
    c <- 5
    y <- jitter(td / tt - a * exp( b * tt ) + c)
    

    (In practice, you won’t know what a, b and c are until afterwards. Here we use them to compare with the answer.)

    The fitting:

    nls(
      y ~ td / tt - a * exp( b * tt ) + c, 
      data = data, 
      start = list(a = 1, b = 1, c = 1)
    )
    

    The answer:

    Nonlinear regression model
      model:  y ~ td/tt - a * exp(b * tt) + c 
       data:  data 
         a      b      c 
    0.4996 2.0008 4.9994 
     residual sum-of-squares: 0.0001375
    
    Number of iterations to convergence: 7 
    Achieved convergence tolerance: 1.604e-06
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a maths problem I am somewhat stumped on. I need to map
Have a look at the following code to find X^y. /* Find exponent in
Do you know a good example of nonlinear programming?, I have search over google,
Have their been any studies related to the importance of how good a software
Have you any idea how to find out if spell check suggestions dialog is
I have a very specific requirement for interpolating nonlinear data using a 6th degree
We have up to several team members that does not work 100% on our
Have a group of related projects running in SQL Server 2005 for which I
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.