title: How to calculate confidence interval of adstock rate calculated using nls function in R?
body: <p>I have calculated adstock rate for TV GRP using nls function of R. I have used below code to calculate it:</p>
  
  <pre><code># Adstock function
  adstock &lt;- function(inp_x, rate=0){
    return(as.numeric(stats::filter(x= inp_x, filter=rate, method="recursive")))
  }
  
  
  rate_TV = nls((Total_Traffic)~b0+b1*adstock(TV_GRP, rate), data = loans, 
                 start=c(b0=0, b1=1,rate=0.1), trace = TRUE, nls.control(maxiter = 100))
  summary(rate_TV)
  </code></pre>
  
  <p>Here, y variable is Total_Traffic and x variable is TV_GRP.
  Now I want to calculate the confidence interval of rate. Is there any way in which I can calculate it. Please help.</p>