Re: [R] Dickey-Fuller Test
tseries (adf.test) On Monday 23 May 2005 12:27, Amir Safari wrote: > Hi All , > Could you please tell using which library ,Dickey-Fuller Test can be run? > Thanks a lot > > __ > > > > [[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html -- * Miguel A. Arranz Tol-Project [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Load package using R code rather than GUI Package menu
library(boot) On Friday 03 June 2005 18:00, John Sorkin wrote: > Is there any way to load a package using R code rather than the Load > Package command in the Package menu? I would like to load the boot > package. > R.2.1.0 Patched > Win 2k. > > Thanks, > John > > John Sorkin M.D., Ph.D. > Chief, Biostatistics and Informatics > Baltimore VA Medical Center GRECC and > University of Maryland School of Medicine Claude Pepper OAIC > > University of Maryland School of Medicine > Division of Gerontology > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > > 410-605-7119 > -- NOTE NEW EMAIL ADDRESS: > [EMAIL PROTECTED] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html -- * Miguel A. Arranz Tol-Project [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Compilation package error
Please, tell us more about the packages and libraries installed. I did compile and installed gstat on a machine running sid64 (unstable) with no problems. The only thing is that I did not compile with the -mieee-with-inexact switch. Hope this helps. On Monday 24 October 2005 17:07, Poizot Emmanuel wrote: > Dear all, > I tried to install gstat package and add the following compilation error : > > > > * Installing *source* package 'gstat' ... > creating cache ./config.cache > checking for gcc... gcc > checking whether the C compiler (gcc ) works... yes > checking whether the C compiler (gcc ) is a cross-compiler... no > checking whether we are using GNU C... yes > checking whether gcc accepts -g... yes > checking how to run the C preprocessor... gcc -E > checking for AIX... no > checking for minix/config.h... no > checking for POSIXized ISC... no > checking for ANSI C header files... yes > checking for working const... yes > checking whether time.h and sys/time.h may both be included... yes > checking for 8-bit clean memcmp... yes > checking for vprintf... yes > checking for strstr... yes > checking for strtod... yes > checking for strtol... yes > checking for drand48... yes > checking for gettimeofday... yes > checking whether byte ordering is bigendian... no > checking for memory.h... yes > checking for ANSI C header files... (cached) yes > checking for gcc option to accept ANSI C... > checking for function prototypes... yes > checking for working const... (cached) yes > checking for complex.h... yes > checking for malloc.h... yes > checking for varargs.h... no > checking for size_t... yes > checking for working const... (cached) yes > checking whether byte ordering is bigendian... (cached) no > checking for u_int > computing machine epsilon(s) > gcc -o macheps ./src/meschach/dmacheps.c > gcc -o macheps ./src/meschach/fmacheps.c > computing M_MAX_INT > gcc -o maxint maxint.c > ./src/meschach/maxint.c: In function 'main': > ./src/meschach/maxint.c:37: warning: incompatible implicit declaration > of built-in function 'printf' > checking char \\0 vs. float zeros > checking for bcopy... yes > checking for bzero... yes > checking for function prototypes > checking for function prototypes in structures > updating cache ./config.cache > creating ./config.status > creating makefile > creating src/config.h > creating src/machine.h > ** libs > gcc -I/usr/lib/R/include -mieee-with-inexact -fPIC -g -O2 -c block.c > -o block.o > gcc -I/usr/lib/R/include -mieee-with-inexact -fPIC -g -O2 -c > chfactor.c -o chfactor.o > gcc -I/usr/lib/R/include -mieee-with-inexact -fPIC -g -O2 -c copy.c > -o copy.o > gcc -I/usr/lib/R/include -mieee-with-inexact -fPIC -g -O2 -c data.c > -o data.o > /tmp/ccXDZili.s: Messages de l'assembleur: > /tmp/ccXDZili.s:8032: ERREUR: Opérande de relocalisation inconnue: > !lituse_jsrdirect > make: *** [data.o] Erreur 1 > ERROR: compilation failed for package 'gstat' > ** Removing '/usr/local/lib/R/site-library/gstat' > ** Restoring previous '/usr/local/lib/R/site-library/gstat' > ---> > > R run on a dec alpha station under Debian Sarge 64 bits (alpha version > of course). > Compiler version is gcc 4.0.2. > > Regards > > > > Emmanuel Poizot > Cnam/Intechmer > B.P. 324 > 50103 Cherbourg Cedex > > Phone (Direct) : (00 33)(0)233887342 > Fax : (00 33)(0)233887339 > -- * Miguel A. Arranz Tol-Project [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Writing output to a file in a loop
That is correct, you have to specify with print or cat what you want to sink. This should work for you: print(summary(fit)) print(logLik(fit)) print(fcv) I hope this helps. On Thursday 10 February 2005 11:40, Wojtek Slusarski wrote: > Hello, > My problem is, that I have to build hundreds of GARCH models to obtain > volatility forecasts. I would like to run a loop, that would build those > forecasts for me. There is no problem, with writing only the results of > the forecasts, but I'd like to have stored results of the models in some > file, that I could check later, what are the models like, to be able to > compare if I should use GARCH(1,1) or GARCH(0,4) or any other, that > suits the data best. The data file looks like that: > > TICKER;DTMMDD;OPEN;HIGH;LOW;CLOSE;VOL > WIG20;19940414;1000,00;1000,00;1000,00;1000,00;71600 > WIG20;19940418;1050,47;1050,47;1050,47;1050,47;99950 > WIG20;19940419;1124,92;1124,92;1124,92;1124,92;138059 > ... > > I wrote a script to do that, but when I use sink() to save the results > in a text file, after running the script files are empty. I read in FAQ, > that in a loop R only computes and prints only some warning messages, > but I don't know how to do that in any other way, to ommit this problem. > Below I enclose the code: > > > > library(tseries) > > wig20 <- read.csv("wig20.txt", sep=";", dec=",") > m <- 2321#upper bound of time series > niter <- 10#length(wig20$CLOSE)- m > fcv <- 0 > > > for (i in 1:niter){ > > m <- m + 1 > r <- 100*diff(log(wig20$CLOSE[1:m])) > y <- r - mean(r) > fit <- garch(y, order = c(1,1)) > > sink("garch21.txt", append = TRUE) > summary(fit) > logLik(fit) > sink() > > cv <- predict(fit, genuine=TRUE) > fcv <- c(fcv,cv[length(cv)/2,1]) > > postscript("garch21.ps",encoding="ISOLatin2", >title = paste("Day: ",wig20$DTMMDD[m]), >paper = "a4", >family = "URWTimes", >append = TRUE) > > plot(fit, ask=FALSE) > > dev.off() > > } > > sink("forecasts.txt") > > fcv > > sink() > > ### > > The most wondering thing for me is that, plots are stored in the ps > file, but only the ones from last iteration. In manuals there is: > > append: logical; currently *disregarded*; just there for >compatibility reasons. > > What does *disregarded* actually mean and when I will be able to add a > title before each set of plots, because now the option title is not > adding anything to file. > > I will be very thankfull for any help. > > Best regards, > Wojtek Slusarski > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Strange Colnames
You probably want to have a look at help(embed). It might be all you need. On Friday 25 February 2005 12:49, Georg Hoermann wrote: > Hello world, > > I am trying to create a matrix of lagged time series with the > following code fragment (I know that I can use acf-function...). > I want to set the variable/column name to something like > "lag 1" etc. If I try to do it I get text like > "lagtest.lagtest.lagtest.lag 1" where does this come from? > > After a conversion to a data.frame it works as expected. > What did I miss? > > Thanks and greetings, > > Georg > == > > > lagtest <- as.ts(seq(1:100)) ; > > for (i in 1:4) {lagtest <- cbind(lagtest,lag(ts_test,i)); > > colnames(lagtest)[i+1]<- paste("lag",i)} > > > colnames(lagtest)[1]<-"H_GW"; > > colnames(lagtest) > > [1] "H_GW" "lagtest.lagtest.lagtest.lag 1" > "lagtest.lagtest.lag 2" > [4] "lagtest.lag 3" "lag 4" > > > # this works... > > > t5 <- as.data.frame(lagtest) > > for (i in 1:4) {names(t5)[i+1] <- paste("var",i) } > > names(t5) > > [1] "H_GW" "var 1" "var 2" "var 3" "var 4" > > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] LOCFIT: What's it doing?
You should definitely read Loader's book. Anyway, in the meantime, you should look an introductory paper that you will find at the Locfit web page. I think that you can set Locfit to estimate at all the sample points, which it does not by default, and also to use a prespecified constant bandwidth, but notice that its definition of the h parameter is not the standard one. Hope this helps, Miguel A. On Thursday 14 April 2005 10:47, Jacho-Chavez,DT (pgr) wrote: > Dear R-users, > > One of the main reasons I moved from GAUSS to R (as an econometrician) was > because of the existence of the library LOCFIT for local polynomial > regression. While doing some checking between my former `GAUSS code' and my > new `R code', I came to realize LOCFIT is not quite doing what I want. I > wrote the following example script: > > #-- >--- # Plain Vanilla NADARAYA-WATSON > estimator (or Local Constant regression, e.g. deg=0) # with gaussian kernel > & fixed bandwidth > > mkern<-function(y,x,h){ > Mx <- matrix(x,nrow=length(y),ncol=length(y),byrow=TRUE) > Mxh <- (1/h)*dnorm((x-Mx)/h) > Myxh<- (1/h)*y*dnorm((x-Mx)/h) > yh <- rowMeans(Myxh)/rowMeans(Mxh) > return(yh) > } > > # Generating the design Y=m(x)+e > n <- 10 > h <- 0.5 > x <- rnorm(n) > y <- x + rnorm(n,mean=0,sd=0.5) > > # This is what I really want! > mhat <- mkern(y,x,h) > > library(locfit) > yhl.raw <- > locfit(y~x,alpha=c(0,h),kern="gauss",ev="data",deg=0,link="ident") > > # This is what I get with LOCFIT > print(cbind(x,mhat,residuals(yhl.raw,type="fit"),knots(yhl.raw,what="coef") >)) > #-- >-- > > Questions: > 1) Why are residuals(.) & knots(.) results different from one another? If I > want m^(x[i]) at each evaluation point i=1,...,n, which one should I use? I > do not want interpolation whatsoever. 2) Why are they `close' but not equal > to what I want? > > I can accept differences for higher degrees and multidimensional data at > the boundary of the support (given the way we must do the regression in > areas with sparse data) But why are these difference present for deg=0 > inside the support as well as at the boundary? The computer would still > give us a result even with a close-to-zero random denominator (admittedly, > not a reliable one). Unfortunately, I cannot get access to a copy of > "Loader, C. (1999) Local Regression and Likelihood, Springer" from my local > library, so a small explanation or advice would be greatly appreciated. > > I do not mind using an improved version of `what I want', but I would like > to understand what am I doing? > > > Thanks in advanced for your help, > > > David Jacho-Chávez > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Multiple periodicities
Derar all, This is a problem that I am unable to solve. I am interested in analyzing some high-frequency data which show two periodicities (periods 5 and 260), It is clear how to estimate models with one periodicity with arima() but I have not been able to include both periodicities. Is there some good way to handle tis kind of problem? Thanks in advane, Miguel A. -- * Miguel A. Arranz Tol-Project [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html