])
plot(Pt)
Rt_init_cond<-0
Rt<-Rt_init_cond*0
Rt[2]<- -a*Rt[1]+a*Et[1]+e[2]
for(i in 2:(n)){
Rt[i]<- -a*Rt[i-1]+a*Et[i-1]+e[i]
}
Rt<-ts(Rt[(length(Rt)-n+1):length(Rt)])
plot(Rt)
I donât think the code above is correct, and I donât even know if this is
the approach
agged values of Y_t+1 from Y_t to Y_t-n. Epsilon_t is, as You
said a vector of random errors.
Any suggestion is very appreciated.
thanks and best regards,
Simone
From: Rui Barradas
Sent: Saturday, December 22, 2012 8:29 PM
To: Simone Gogna
Cc: r-help@r-project.org
Subject: Re: [R] creating a f
Dear R users,
Iâd like to create a function as:
Y.t+1 = Y.t + (1\p)*summation(x(Y.t,Y.t-1,...)) + epsilon.t
where x is a function of Y.t, Y.t-1 and so on, epsilon is a random error and p
is a parameter.
Do you think something of the following form might be appropriate?
Y<-function(Y,p,x,epsi
3 matches
Mail list logo