search for: dynlm

Displaying 20 results from an estimated 53 matches for "dynlm".

Did you mean: dynam
2009 Apr 19
1
dynlm question: How to predefine formula for call to dynlm(formula) call
I want to set up a model with a formula and then run dynlm(formula) because I ultimately want to loop over a set of formulas (see end of post) R> form <- gas~price R> dynlm(form) Time series regression with "ts" data: Start = 1959(1), End = 1990(4) <snip> Works OK without a Lag term R> dynlm(gas ~ L(gas,1)) Time series reg...
2012 Aug 27
0
How can I find the principal components and run regression/forecasting using dynlm
...Stock and Watson (1999) "Forecasting Inflation". All data are time series. Now I can run the program using single factor (first principal component), but I don't know how to write a program for muli-factor model (first several principal component). The core subroutine called is dynlm, which runs OLS for time series. I think the primary problem is that (1) I don't how to run dynlm with matrix rather than vector as explanatory variables (2)I don't know how to do a forecast with the estimation results of dynlm properly. In lm model, function "predict.lm" can do i...
2013 Feb 26
1
problem with nested loops
...on price indices for 7 countries. I use the fitted values from reg1 in the reg2 model. The interior loop executes without error as long as I explicitly specify the data set, i.e. data=dat70. However the code fails to execute if I specify the model in the form of the commented line, i. e reg1 <-dynlm(form1,data=Dnames[j]) I get the following error message: Error in merge.zoo(USA, lag(USA, k = -1), lag(USA, k = -2), lag(Canada, : object 'USA' not found Apparently the Dnames[j] does not evaluate to the dataset name. Does anyone have a solution to my problem? The values in Names a...
2008 Oct 15
2
dynlm and lm: should they give same estimates?
Hi, I was wondering why the results from lm and dynlm are not the same for what I think is the same model. I have just modified example 4.2 from the Pfaff book, please see below for the code and results. Can anyone tell my what I am doing wrongly? Many thanks, Werner set.seed(123456) e1 <- rnorm(100) e2 <- rnorm(100) y1 <- ts(cumsum(e1)...
2006 May 15
3
Dyn or Dynlm and out of sample forecasts
All: How do I obtain one step ahead out-of-sample forecasts from a model using "dyn" or "dynlm" ? Thanks! Best, John [[alternative HTML version deleted]]
2008 Jan 28
0
dynlm: new version 0.2-0
Dear useRs, I've release a new version of the "dynlm" package to CRAN which adds two new features: o instrumental variables regression (two-stage least squares) via formulas like dynlm(y ~ x1 + x2 | z1 + z2 + z3, data = mydata) where z1, z2, z3 are the instruments which can again contain lags/differences/season via the d()/L...
2007 Jan 23
1
SARIMA with dynlm
Does anyone have an exemple of how to fit a SARIMA model , with a MA part, with the package dynlm? Best regards. --------------------------------- [[alternative HTML version deleted]]
2011 Jun 21
1
dynlm
Dear All, I'm trying to use dynlm to fit a time series. I have 3 seasonal terms. Here is an example of the problem. This is my time variable, hourly data: timeSeries <- seq(as.POSIXct("2011-01-01 00:00:00"), as.POSIXct("2011-12-31 23:00:00"), by="hour") My response is: y <- rnorm(length(t)...
2009 Nov 23
2
dynlm predict with newdata?
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091122/6a079ab8/attachment-0001.pl>
2005 Apr 28
0
new package: dynlm 0.1-0
Dear useRs, recently, there were several discussions on R-help about how to conveniently fit dynamic linear models and time series regressions. The package dynlm tries to address this problem by 1. providing some more functions like lags L() and differences d() and season() in the formula specification of a model and 2. preserving the time series attributes of the data. A first version of the dynlm package (which depends on the newest zoo version) is now...
2007 Apr 20
0
help for dynlm command
Suppose we have the time series “y” When I regress this series on its first lag then I use the following command in dynlm as r=dynlm( y~L(y,1)) if I put the command of summary of above regression model then by the command summary (r ) I will get the following out put elements Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) __ __ _...
2005 Apr 28
0
new package: dynlm 0.1-0
Dear useRs, recently, there were several discussions on R-help about how to conveniently fit dynamic linear models and time series regressions. The package dynlm tries to address this problem by 1. providing some more functions like lags L() and differences d() and season() in the formula specification of a model and 2. preserving the time series attributes of the data. A first version of the dynlm package (which depends on the newest zoo version) is now...
2011 Jun 20
0
dynlm question
Dear All, I'm trying to use dynlm to fit a time series. I have 3 seasonal terms. Here is an example of the problem. This is my time variable, hourly data: timeSeries <- seq(as.POSIXct("2011-01-01 00:00:00"), as.POSIXct("2011-12-31 23:00:00"), by="hour") My response is: y <- rnorm(length(t)...
2012 Apr 12
1
Could dynlm function work for xts objects?
It seems to only works for zoo or ts objects? I tried to run it for xts objects, and error message occurs. Once I coerce it to be an zoo object (by as.zoo), it works. Error message: Error in model.frame.default(formula = dynformula(PIh - PI ~ L(X, 0:i) + : variable lengths differ (found for 'L(X, 0:i)') In addition: Warning messages: 1: In zoo(coredata(x), order.by = index(x), ...)
2011 Nov 14
3
What is the CADF test criterion="BIC" report?
...ax.lag.y = 14, criterion="BIC") > summary(ADFt) Augmented DF test ADF test t-test statistic: -1.389086 p-value: 0.855681 Max lag of the diff. dependent variable: 1.000000 Call: dynlm(formula = formula(model), start = obs.1, end = obs.T) Residuals: Min 1Q Median 3Q Max -0.79726 -0.20587 -0.03332 0.23840 0.70460 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 24.342321 17.435476 1.396 0.167 trnd 0.009959...
2007 Mar 22
2
dynamic linear models in R
Hi all, I've just started working my way through Mike West and Jeff Harrison's _Bayesian Forecasting and Dynamic Models_, and I was wondering if there were any publically-available packages to handle dynamic linear models, as they describe. I found the "dynlm" package, but either I don't yet understand what's going on or that package uses a different sense of the phrase "dynamic linear model." I would expect a fit of a dynamic linear model to produce a time series of parameter estimates, not just single coefficients as that funct...
2024 Mar 14
0
CADFtest difference between max.lag.y with criterion and without criterion
....y = 20, type = "drift", criterion="BIC")) Augmented DF test ADF test t-test statistic: 0.1070651 p-value: 0.9663296 Max lag of the diff. dependent variable: 2.0000000 Call: dynlm(formula = formula(model), start = obs.1, end = obs.T) Residuals: Min 1Q Median 3Q Max -116.646 -3.719 0.163 4.444 110.891 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.758e-01 2.649e-01 1.041 0.297853 L(y, 1) 2.256e-05...
2005 Dec 14
1
broken package?
I've just tried to install the tseries package (which seems to include quite a bit) and got the following results: package 'dynlm' successfully unpacked and MD5 sums checked package 'leaps' successfully unpacked and MD5 sums checked package 'chron' successfully unpacked and MD5 sums checked package 'fCalendar' successfully unpacked and MD5 sums checked package 'strucchange' successfully unp...
2010 Dec 01
0
Multivariate time series - Poisson with delayed lags
Hi all, How can a multivariate Poisson time series be modeled? Aspects of glm, forecast, dse and dynlm seem relevant but not quite complete--but hopefully what I am missing is how to assemble them effectively. What I am looking to do is model my dependent variable y_t as a Poisson family function of lags of several independent variables and lags of y_t. I would like to include all lags up through...
2011 Feb 16
0
predict not complete?
take this code library(dynlm) test=dynlm(diff(log(y))~ lag(x, -1) + lag(z, -1)) fc=predict(test) fc when I run this and look at "fc", the values there only go as long as the sample (of y) goes, but it should be one further, right? since the other values are lagged. Is predict the wrong function to reach this? Th...