I am running loop in R for time series (5y point) data. I want to get a result for new data (rata) using a formula (include initial and prior values). But, I get something weird. Gere is my code: n=7 set.seed(1) #data ta=c(1950,1955,1960,1965,1970,1975,1980) ra=c(1.7,1.3,-2.7,-2.4,3.3,5.7,1.7) rata=matrix(c(ta,ra),nrow=7) #rata ## initials a=runif(n,1,10) b=runif(n,0,10) c=runif(n,-100,100) d=runif(n,0,100) #priors p=runif(n,0,1) q=rnorm(n,c,d) […]

- Tags ..., ' 1990', 'ra', ] 1950 7.326510 [2, ] 1955 -53.476174 [3, ] 1960 19.722856 [4, ] 1965 41.977856 [5, ] 1970 -6.929676 [6, ] 1975 47.726462 [7, ] 1980 15.949641 Can someone help me with this, 0, 1, 1.3, 1.7) rata=matrix(c(ta, 1) q=rnorm(n, 10) b=runif(n, 10) c=runif(n, 100, 100) #priors p=runif(n, 100) d=runif(n, 1955, 1960, 1965, 1970, 1975, 1980) ra=c(1.7, 1995 and 2000 #forecast n+1, 2.4], 2.7, 21, 3.3, 5.7, a, and the result I got is [1] 1701.7452 611.4637 965.9015 1221.5637 963.7180 414.4448 1652.7423 [1] 7.326510 -53.476174 19.722856 41.9, b) e=rnorm(n, c--, d) s=rinvgamma(n, I am running loop in R for time series (5y point) data. I want to get a result for new data (rata) using a formula (include initial and prior, I get something weird. Gere is my code: n=7 set.seed(1) #data ta=c(1950, I want to forecast for the next year 1985, i] : subscript out of bounds The supposed to result should be like this > rat [, i]-q))+ q +e print(new.rat) } But I couldn't get the answer., i]-q))+ q +e print(rat) } I try this, N N=5 for(i in n+t:N){ new.rat = (p*(new.rata[, nrow=7) #rata ## initials a=runif(n, please? Then, s) ### model for(i in 1:n){ rat = (p*(rata[