[R] TS Forecasting/Prediction

2010-06-15 Thread Lars Bergemann
Hey. Looking at EuStockMarkets[1:1860] -- the DAX. ar() estimates an AR(1) model with \alpha_1 ~= 1 and high \sigma^2. But forecasting from a given X_t_0 according to an AR(1) model with \alpha_1 = 1 should be X_t_0 for all X_t, t t_0 . ? How do you do this forecasting in R?

[R] Plotting Two Surfaces in one plot with wireframe() using groups=

2009-07-16 Thread Lars Bergemann
Hi. I tried the following: F-function(x,y,b1,b2,b3) b1/(1+b2*(x+b3*y)); t-data.frame(ExM=c(T$ExM,F(T$S1,T$S2,0.2,0.2,51.28205)),S1=rep(T$S1,2),S2=rep(T$S2,2),gr=c(rep(1,length(T$ExM)),rep(2,length(T$ExM; library(lattice); wireframe(ExM ~ S1 * S2, data = t, groups=gr); where T

[R] How does logLik(lm(...)) find the maximum log likelihoods

2009-07-14 Thread Lars Bergemann
Hi. Thanks for your help with my previous question (comparing two lm() models with a maximum likelihood ratio test) I had a look at lrtest from the package lmtest as it has been suggested to me, but I am not 100% sure if that is the right thing to do ... lrtest uses the same log

[R] How to perform a Likelihood-ratio test?

2009-07-13 Thread Lars Bergemann
Hi. I would like to use a likelihood-ratio test to compare a linear model (lm()) to another linear model containing the first one to see if the extra factors are needed - but I was unable to find any help on how to do that. Could you help me and tell me what to do? Or tell me where to find

[R] Two-way ANOVA gives different results using anova(lm()) than doing it by hand

2009-07-08 Thread Lars Bergemann
Hey! Could you please take a quick look at what I have done? Somehow I get wrong results using the anova(lm()) combination compared to doing a two way ANOVA by hand. Running: Data-read.table(Data.txt); g-lm(ExM~S1*S2,Data); anova(g); Gives: Analysis of Variance Table

[R] Color of ecdf plots

2009-07-03 Thread Lars Bergemann
Hi. I have the following two ecdf plots in one graph: plot( ecdf(), do.points=FALSE, verticals=TRUE, main=paste(Ecdf of distances ,DIM,sep=), col=red ); lines( ecdf(), do.points=FALSE, verticals=TRUE ); How do I change the color of the resulting graph?