0

I am working on Market Mix Modeling - I need to capture impact of different marketing variables on sales of a product through s-curve. Below is the equation I need to use -

sales = 1/[1+exp((a1-TV)/a2)] * 1/[1+exp((b1-Radio)/b2)] * ...(other-variables)...

I tried NLS but kept getting starting value error. Then-after, I used self start function in nls - Sslogis but it could be used on only one variable at a time and not the whole function as stated above.

How can I fit more than 1 sigmoidal(s-curve) function in a nonlinear regression model?

Wayne Conrad
  • 103,207
  • 26
  • 155
  • 191
  • 1
    Welcome to SO. Please carefully read [this](http://stackoverflow.com/help/mcve) and [this](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) and then update your question to conform with these guidelines. – jlhoward Sep 20 '15 at 21:36

1 Answers1

0

Without a full dataset it's hard to tell. I've had a similar problem so what I did was use tryCatch in a for a loop.

For (i in 1:10){

        tryCatch(nls(y~SSlogis(x[,i],rest of the arguments..),error=function(e) 0)

}

This will replace the error with a 0 which would mean no fit could be made.

You can replace the errors with anything. 0 made the most sense for my data.

Ted Mosby
  • 1,426
  • 1
  • 16
  • 41