similar to: forecasting linear regression from lagged variable

Displaying 20 results from an estimated 5000 matches similar to: "forecasting linear regression from lagged variable"

2005 Aug 13
1
How to make a lagged variable in panel data?
Suppose we observe N individuals, for each of which we have a time-series. How do we correctly create a lagged value of the time-series variable? As an example, suppose I create: A <- data.frame(year=rep(c(1980:1984),3), person= factor(sort(rep(1:3,5))), wage=c(rnorm(15))) > A year person wage 1 1980 1 0.17923212 2 1981
2004 Oct 29
2
lag variable addition to data frame question
Hi, I was wondering if there is a more efficient way of handling the following method of creating a lagged value in a data frame without using the recursive 'for(i in 1:n)' loop and without using as.ts #Steps to creating a lag variable in a data frame 'my.dat.fr' # with 275 columns, 2400 rows of numbers and factors . The #variable x is a factor of #with five different levels the
2012 Mar 19
1
Lag based on Date objects with non-consecutive values
Hello all, I need to figure out a way to lag a variable in by a number of days without using the zoo package. I need to use a remote R connection that doesn't have the zoo package installed and is unwilling to do so. So that is, I want a function where I can specify the number of days to lag a variable against a Date formatted column. That is relatively easy to do. The problem arises when I
2008 Aug 11
3
Peoblem with nls and try
Hello, I can`t figure out how can increase the velocity of the fitting data by nls. I have a long data .csv I want to read evry time the first colunm to the other colunm and analisy with thata tools setwd("C:/dati") a<-read.table("Normalizzazione.csv", sep=",", dec=".", header=F) for (i in 1:dim(a[[2]]]) { #preparazione dati da analizzare
2008 May 22
1
How to account for autoregressive terms?
Hi, how to estimate a the following model in R: y(t)=beta0+beta1*x1(t)+beta2*x2(t)+...+beta5*x5(t)+beta6*y(t-1)+beta7*y(t-2)+beta8*y(t-3) 1) using "lm" : dates &lt;- as.Date(data.df[,1]) selection&lt;-which(dates&gt;=as.Date("1986-1-1") &amp; dates&lt;=as.Date("2007-12-31")) dep &lt;- ts(data.df[selection,c("dep")]) indep.ret1
2013 Apr 26
1
Regression coefficients
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is
2002 Jun 20
1
Possible bug with glm.nb and starting values (PR#1695)
Full_Name: Ben Cooper Version: 1.5.0 OS: linux Submission from: (NULL) (134.174.187.90) The help page for glm.nb (in MASS package) says that it takes "Any other arguments for the glm() function except family" One such argument is start "starting values for the parameters in the linear predictor." However, when called with starting values glm.nb returns: Error in
2012 Feb 03
1
A question on Unit Root Test using "urca" toolbox
Hello, I have a question on unit root test with urca toolbox. First, to run a unit root test with lags selected by BIC, I type: > CPILD4UR<-ur.df(x1$CPILD4[5:nr1], type ="drift", lags=12, selectlags ="BIC") > summary(CPILD4UR) The results indicate that the optimal lags selected by BIC is 4. Then I run the same unit root test with drift and 4 lags:
2013 Apr 27
1
Selecting ridge regression coefficients for minimum GCV
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is advisable to
2012 Jan 18
1
forecasting a time series
Couldn't find this in the archives. I'm fitting a series of historical weather-related data, but would like to use the latest values to forecast. So let's say that I'm using 1970-2000 to fit a model (using fourier terms and arima/auto.arima), but now would like to use the last X values to predict tomorrow's weather. I'm at a loss. All the functions I've come across
2010 Mar 19
1
Arima forecasting
Hello everyone, I'm doing some benchmark comparing Arima [1] and SVR on time series data. I'm using an out-of-sample one-step-ahead prediction from Arima using the "fitted" method [2]. Do someone know how to have a two-steps-ahead forecast timeseries from Arima? Thanks, Matteo Bertini [1] http://robjhyndman.com/software/forecast [2] AirPassengers example on page 5
2007 Dec 04
1
Best forecasting methods with Time Series ?
Hello, In order to do a future forecast based on my past Time Series data sets (salespricesproduct1, salespricesproduct2, etc..), I used arima() functions with different parameter combinations which give the smallest AIC. I also used auto.arima() which finds the parameters with the smallest AICs. But unfortuanetly I could not get satisfactory forecast() results, even sometimes catastrophic
2009 Dec 16
1
R and Hierarchical Forecasting
Hello, does anyone know of any R routines capable of whats called Hierarchical Forecasting, reconciling the different hierarchies. Example: A top down forecast where the corporate forecast is created and then all the regions within the corporate entity are also forecasted, with the constraint they sum to the corporate forecast.
2009 Jan 23
1
forecasting error?
Hello everybody! I have an ARIMA model for a time series. This model was obtained through an auto.arima function. The resulting model is a ARIMA(2,1,4)(2,0,1)[12] with drift (my time series has monthly data). Then I perform a 12-step ahead forecast to the cited model... so far so good... but when I look the plot of my forecast I see that the result is really far from the behavior of my time
2008 Jul 06
1
Different Autocorrelation using R and other softwares
Dear All, Would like to ask the inconsistency in the autocorrelation from R with SPSS/Minitab. I have tried a dataset x with 20 data (1-20) and ask R to give the autocorrelation of different lags using the command < acf(x, lag.max=100, type = "correlation"), However while SPSS and Minitab give the same answers (0.85 for lag1), R gives 0.3688 which is much smaller. Obviously, the
2010 Oct 07
1
Forecasting with R/Need Help. Steps shown below with the imaginary data
1. This is an imaginary data on monthly outcomes of 2 years and I want to forecast the outcome for next 12 months of next year. data Data1; input Yr Jan Feb Mar Apr May June July Aug Sept Oct Nov Dec; datalines; 2008 12 13 12 14 13 12 11 15 10 12 12 12 2009 12 13 12 14 13 12 11 15 10 12 12 12 ; run; I converted the above data into the below format to use it in R as it was giving error: asking
2009 Jan 21
1
forecasting issue
Hello everybody! I have a problem when I try to perform a forecast of an ARIMA model produced by an auto.arima function. Here is what I'm doing: c<-auto.arima(fil[[1]],start.p=0,start.q=0,start.P=0,start.Q=0,stepwise=TRUE,stationary=FALSE,trace=TRUE) # fil[[1]] is time series of monthly data ARIMA(0,0,0)(0,1,0)[12] with drift : 1725.272 ARIMA(0,0,0)(0,1,0)[12] with drift
2012 Dec 03
2
How to rename the columns of as.table
Hello guys .. I would like to have some help about as.table . I made a table with the autocorrelations of the returns whit 10 lags and i get this : autocorrelazione2 <- as.table(c((cor(r2[-1151,],lag(r2))),(cor(r2[- c(1151,1150),],lag(r2, k=2))),(cor(r2[- c(1151,1150,1149),],lag(r2, k=3))),(cor(r2[- c(1151,1150,1149,1148),],lag(r2, k=4))),(cor(r2[- c(1151,1150,1149,1148,1147),],lag(r2,
2017 Jul 12
2
Question on Simultaneous Equations & Forecasting
Hello, I have estimated a simultaneous equation model (similar to Klein's model) in R using the system.fit package. I have an identity equation, along with three other equations. Do you know how to explicitly identify the identity equation in R? I am also trying to forecast the dependent variables in the simultaneous equation model, while incorporating the identity equation in the
2009 Jul 27
2
Forecasting Inflation
Dear All, I wanted to forecast Inflation for Indian Economy. please send what techniques to be used after the variable selection. WPI, CPI, Money supply, IIP, Interest rate and so on..How i can use R for the same [[alternative HTML version deleted]]