2
$\begingroup$

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]
      koef[i-1,4]=ar2$var.coef[2,2]
}

data:
yr  water
1986    0.01
1987    -0.63
1988    -0.14
1989    2.52
1990    1.96
1991    0.6
1992    1.82
1993    1.82
1994    0.89
1995    1.32
1996    -1.43
1997    0.75
1998    0.02
1999    0.69
2000    1.65
2001    -1
2002    0.66
2003    0.09
2004    -0.08
2005    0.4
2006    -0.87
2007    1.2
2008    1.1
2009    0.07
2010    -2.57
$\endgroup$
  • 4
    $\begingroup$ Please clarify your equation. Either use the appropriate (tex-based) mark-up or add parentheses. $\endgroup$ – Roland Mar 3 '14 at 12:25
  • $\begingroup$ This is not an AR(2) model. you can't estimate it with arima $\endgroup$ – Aksakal Mar 3 '14 at 15:52
1
$\begingroup$

If you treat $\beta_t$ as a time-varying coefficient, then it looks like you will have to estimate more unknowns than available data.

If on the other hand $\beta_t$ is treated as a random variable following the standard logistic distribution, and if the process $\{\beta_t\}$ is i.i.d and independent of $Y_{t-1}$, then the random variable

$$U_t = \frac{\exp(\beta_t)}{1+\exp(\beta_t)} \sim U[0,1]$$

i.e. it follows a uniform in $[0,1]$, since its functional form is the cumulative distribution function of a standard logistic random variable (this is the "probability integral transform" result). Then you have ($\mathcal F_{t-1}$ is data available up to $t-1$)

$$E[Y_t\mid \mathcal F_{t-1}]=a_0Y_{t-1} + a_1E[U_tY_{t-1}\mid \mathcal F_{t-1}]+bY_{t-2}+\delta E[\epsilon_t \mid \mathcal F_{t-1}]$$

$$\Rightarrow E[Y_t\mid \mathcal F_{t-1}]=a_0Y_{t-1} + a_1E[U_t\mid \mathcal F_{t-1}]Y_{t-1}+bY_{t-2}$$

$$\Rightarrow E[Y_t\mid \mathcal F_{t-1}]=\left(a_0 + \frac 12 a_1\right)Y_{t-1}+bY_{t-2}$$

Of course I cannot know if this formulation is useful to you, since it does not provide an estimate for the series $\{\beta_t\}$ which could be your desired target. This formulation assumes that $$\beta_t \sim \Lambda \left (0, \frac {\pi^2}{3}\right)$$

You could extend this to a stable autocorrelated series for $\beta_t$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ What will the end result of estimation procedure will be? An equation with a time varying coefficient on $Y_{t-1}$? If yes, this time-varying coefficient will have to be expressed as a function of something so that it can change as time passes - a function of the index $t$ or of its own past. How the estimation algorithm will produce one or the other? $\endgroup$ – Alecos Papadopoulos Mar 3 '14 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.