n <- length(USinf)
shift<-201
u1<-c((1:shift)/shift,rep(0, n-shift))
u2<-c(rep(0, shift),(1:(n-shift))/(n-shift))
u<-(1:n)/n
switch <- c(rep(1,shift), rep(0, n-shift))
x1<-switch*u
x2<-(1-switch)*u
test <- data.frame(USinf, x1=x1, x2=x2)
application(formula=USinf~x1+x2,data=test,N=150,S=50,B=10,
start = c(0.16,2.0,-7,8,-3,0.25,-0.25,0.01),
d.order=4,s.order=2,nr.cores=1)
Run the code above in your browser using DataLab