[R] Function ar() in package stats: AIC procedure and time series length

2013-03-11 Thread Andreas Klein
Dear R users, I took a closer look to the AIC-procedure for determining the order m of an VAR(m) process of the function ar() in package stats. >From the original code (source: >http://cran.r-project.org/src/base/R-2/R-2.15.3.tar.gz -> >R-2.15.3\src\library\stats\R\ar.R -> lines 95 to 98) [..

[R] Question on density values obtained from kde2d() from package MASS

2011-11-24 Thread Andreas Klein
Hello, I am a little bit confused regarding the density values obtained from the function kde2d() from the package MASS because the are not in the intervall [0,1] as I would expect them to be. Here is an example: x <- c(0.0036,0.0088,0.0042,0.0022,-0.0013,0.0007,0.0028,-0.0028,0.0019,0.0026,-0

[R] Block length for Bivariate Stationary Bootstrap for Inference for Correlation

2011-11-18 Thread Andreas Klein
Hello, I am searching for a method, algorithm or some solution to the following problem: I need an estimator for the block length of two series to bootstrap the correlation coefficient with the stationary bootstrap procedure. The problem here: the two series have different block lengths! Here

[R] Function not found, maybe respective package has to be put in environment?

2011-11-13 Thread Andreas Klein
Hello everybody, I have a problem and would like to start with an example: library(snow) library(tseries) fn <- function(x) adf.test(x) clusterApply(cl=cl, x=x , fun=fn) R cannot find the function adf.test() because it is inside the function fn(). This problem does not occur when, for example

[R] Robust covariance matrix with NeweyWest()

2011-09-28 Thread Andreas Klein
Dear R-users, I would like to compute a robust covariance matrix of two series of realizations of random variables: ###Begin Example### data <- cbind(rnorm(100), rnorm(100)) model <- lm(data ~ 1) vcov(model) library(sandwich) NeweyWest(model) #produces an error ###End Example### NeweyWest()

[R] BCa-intervals not defined in boot.ci() for tsboot() -> package: boot

2010-08-01 Thread Andreas Klein
Hello everybody, when I create an object of class boot with the function tsboot() from the package boot and try to compute several types of confidence intervals with boot.ci("object of class boot created with tsboot") I obtain the warning message, that "BCa-intervals are not defined for time-se

[R] Package for Sieve Bootstrap Methods

2010-03-09 Thread Andreas Klein
Hello R-users. Is there a package which handles sieve bootstrap methods in various time series applications? Method of Sieve Bootstrap by Bühlmann, P. (1995, Technical Report; published 1997 in the Journal of the Bernoulli Society): http://ftp.stat.berkeley.edu/tech-reports/431.pdf Thank you i

[R] Corrado's Rank Test implemented in R?

2009-12-15 Thread Andreas Klein
Dear R users. Does anyone know a package where the non-parametric rank test from Corrado (A nonparametric test for abnormal security-price performance in event studies, Charles J. Corrado, 1989, Journal of Financial Economics) for event studies is implemented? Sincerely Andreas. __

[R] TAR Models and predictive residuals

2009-02-19 Thread Andreas Klein
Hello R users. There is a paper from Ruey Tsay with the title: "Testing and Modelling Threshold Autoregressive Processes", published in 1989 in the Journal of the American Statistical Association (March, Vol. 84, No. 405). Mr. Tsay describes a very interesting way of identifying and modelling

[R] Package for Markov (Regime) Switching (ARMA) Models

2009-02-15 Thread Andreas Klein
Hello R-Users Is there a package in R, that handles Markov (Regime) Switching (ARMA) Models for time series modelling and prediction? Thank you very much. Regards, Andreas. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] Variance of AR-Process.

2009-02-06 Thread Andreas Klein
Hello. How can I calculate the theoretical process variance of an AR-Process in R? Is there a specific function given in any R package? Regards, Andreas. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

[R] Model Based Bootstrap of an MA(1)-Modell (with R-code)!

2009-01-31 Thread Andreas Klein
Hello. I want to calculate percentile intervals for the coefficient of an MA(1)-Model, but it doesn't work. Code for model based bootstrap based upon a MA(1)-Modell and building a bootseries recursivley (takes around 4 minutes to compute): y <- arima.sim(100,model=list(order=c(0,0,1),ma=0.5

[R] Standard Errors of Coefficients

2009-01-29 Thread Andreas Klein
Hello. I estimated a VAR(1) TSmodel (var_1) with estMaxLik from the dse1 package given a TSdata object (mydata). est.model <- estMaxLik(var_1,mydata) How can I obtain the standard errors for the four coefficients of the estimated model to check for significance? - Is it yet calculated and I ca

[R] How to analyse and model 2 time series, when one series needs to be differenced?

2009-01-26 Thread Andreas Klein
Hello. How can I analyse the cross-correlation between two time series with ccf, if one of the time series need to be differenced, so it is stationary? The two time series differ when in length and maybe ccf produces not the correct cross-correlation?! Another problem: How can I model the two t

[R] Vector Autocorrelation Function in R?

2009-01-21 Thread Andreas Klein
Hello. Does anyone know, if there is a function in R to compute the vector autocorrelations? Thank you in advance. Regards, Andreas. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] How to compute p-Values

2009-01-14 Thread Andreas Klein
uot; > Datum: Mittwoch, 14. Januar 2009, 16:40 > I think we are at the stage where it is your responsibility > to provide some code to set up the problem. > > --David Winsemius > On Jan 14, 2009, at 9:23 AM, Andreas Klein wrote: > > > Hello. > > > > What I wan

Re: [R] How to compute p-Values

2009-01-14 Thread Andreas Klein
two sided test like described above? Regards, Andreas --- gregor rolshausen schrieb am Mi, 14.1.2009: > Von: gregor rolshausen > Betreff: Re: [R] How to compute p-Values > An: "r help" > Datum: Mittwoch, 14. Januar 2009, 11:31 > Andreas Klein wrote: > >

[R] How to compute p-Values

2009-01-14 Thread Andreas Klein
Hello. How can I compute the Bootstrap p-Value for a one- and two sided test, when I have a bootstrap sample of a statistic of 1000 for example? My hypothesis are for example: 1. Two-Sided: H0: mean=0 vs. H1: mean!=0 2. One Sided: H0: mean>=0 vs. H1: mean<0 I hope you can help me Thanks i

[R] How to compute Bootstrap p-values

2009-01-09 Thread Andreas Klein
How can I compute the Bootstrap p-value for the mean of x? H_0: "mean of x" = 0 vs. H_1: "mean of x" != 0 Thank you in advance. Sincerely, Andreas Klein. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

[R] Block Bootstrap Methods for Multivariate Time Series

2008-10-30 Thread Andreas Klein
Hello. I have a problem with selecting the right block size, when I want to bootstrap multivariate non-iid time series. Assume we have N time series each of length T and obtain for each time series an optimal block size l. So we get l1, l2,..., lN optimal block sizes. When I want to apply a blo

[R] Bootstrap Panel Data

2008-10-27 Thread Andreas Klein
Hello. I have serveral problems obtaining percentile intervals via bootstrap in panel data: Assuming a TxN panel with T observations across N groups and T>>N. I want to apply the two step Fama/MacBeth procedure (FM), so I have to look, if the mean of the estimated slopes over time is significa

[R] Model Based Bootstrap

2008-05-06 Thread Andreas Klein
Hello. Has anyone any idea how a function would look like of a model based bootstrap, when the underlying time series follows an ARIMA(1,1,1)-process? A pure AR-process is no problem, but what is, if the time series need to be differentiated of order one or above and the additional MA-part? Sam

[R] Optimization with nonlinear constraints

2008-03-26 Thread Andreas Klein
g,p constant > 0 and x1,x2,x3 > 0 also: a,b,c > d,e,f I hope you can help me with some code for the above problem so I can transfer it to my "real" problem. You can also put some real numbers for the above problem. I only wanted to abstract the problem with some general cons

[R] Optimization with constraint.

2008-03-14 Thread Andreas Klein
Hello. I have some problems, when I try to model an optimization problem with some constraints. The original problem cannot be solved analytically, so I have to use routines like "Simulated Annealing" or "Sequential Quadric Programming". But to see how all this works in R, I would like to start

[R] Bootstrap Correlation Coefficient with Moving Block Bootstrap

2007-11-29 Thread Andreas Klein
Hello. I have got two problems in bootstrapping from dependent data sets. Given two time-series x and y. Both consisting of n observations with x consisting of dependent and y consisting of independent observations over time. Also assume, that the optimal block-length l is given. To obtain my bo

[R] Significance-Problems by using arma/xreg.

2007-11-02 Thread Andreas Klein
Hello. I've got a problem with arma/xreg. I would like to get a better model-fit by implenting some external explanatory variable, so I thought I can implement it by expand the arima-function with an xreg-argument: I have two stationary data vectors y and x of length 201: y <- c(0.935179888,1.09

[R] Bandwidth selection for kernel regression.

2007-10-27 Thread Andreas Klein
ooth(), but there is still the bandwidth to select. Have a nice weekend and thanks a lot. Sincerely Andreas Klein. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.or

[R] Estimate correlation with bootstrap

2007-09-20 Thread Andreas Klein
Hello. I would like to estimate the correlation coefficient from two samples with Bootstrapping using the R-function sample(). The problem is, that I have to sample pairwise. For example if I have got two time series and I draw from the first series the value from 1912 I need the value from 1912