Displaying 2 results from an estimated 2 matches for "gogna".
Did you mean:
gogga
2013 Jan 03
2
simulation
...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 I have to take.
Any suggestion is warmly appreciated.
thanks,
Simone Gogna
[[alternative HTML version deleted]]
2012 Dec 22
1
creating a function
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,epsilon){
for (i in 2:length(Y)) {