I have calculated adstock rate for TV GRP using nls function of R. I have used below code to calculate it:
# Adstock function
adstock <- 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)
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.