# help on how to include term $\exp(β_t)/(1+\exp(β_t))$ in AR(2) model

I am trying to include a term in an AR(2) model: $$Y_t=\left( a_0+a_1 \frac{\exp(\beta_t)}{1+\exp(\beta_t)}\right)Y_{t-1}+bY_{t-2}+\delta\epsilon_t$$

Can anyone please help me with this? I don't seem to be able include this in the R code.

data=read.table("water.txt",header=T)
n=ncol(data)
koef=matrix(0,n-1,4)
rownames(koef)=names(data)[-1]
colnames(koef)=c("a1","a2","var.a1","var.a2")
for(i in 2:n) {
ser=log(data[,i])
ar2=arima(ser,order=c(2,0,0),xreg=data$year) koef[i-1,1]=ar2$coef[1]
koef[i-1,2]=ar2$coef[2] koef[i-1,3]=ar2$var.coef[1,1]