Re: [R] State space models with regime switching

2013-05-08 Thread Matthieu Stigler
Hi Indeed the tsDyn package implements two types of regime switching models, where AR coefficients switch between two regimes, with abrupt transition (setar) or smooth transition (lstar) from one regime to the other. Note however that these are simply AR models in the standard form, not in the

Re: [R] ZA unit root test lag order selection

2013-04-16 Thread Matthieu Stigler
Hi Anonymous There are different methods to select lags in unit roots tests, the two you mention are not fundamentally wrong, and belong to the standard methods used, even if the IC selection is maybe now the prefered solution. Note there is some work from Perron and Ng with a refined selection

Re: [R] E-learning environment for R

2013-04-04 Thread Matthieu Stigler
Hi Pekka There was last semester a online class on coursera.org, given by Roger Peng: https://www.coursera.org/course/compdata I am afraid however that class won't be given that semester, but maybe it is still possible to access the archives, video and exercises? Best Matthieu On 28/03/2013

Re: [R] foreach loop, stata equivalent

2013-02-19 Thread Matthieu Stigler
Hi Nelissa I hope the answers from Joshua and Milan helped you figure out a good solution. So basically in R you have two big parallel packages, the parallel/snow described by Joshua, or the foreach one. If you would be to use foreach, you would need probably a nested loop, which is described in

[R] hessian fails for box-constrained problems when close to boundary?

2012-11-15 Thread Matthieu Stigler
Hi I am trying to recover the hessian of a problem optimised with box-constraints. The problem is that in some cases, my estimates are very close to the boundary, which will make optim(..., hessian=TRUE) or optimHessian() fail, as they do not follow the box-constraints, and hence estimate the

Re: [R] fit a threshold function with nls

2012-10-23 Thread Matthieu Stigler
Hi You indeed cannot use conventional optimisation algorithms as the indicator function is discontinuous, with no derivative. The search hence has to be done with a grid search over each potential threshold value, which is termed conditional/concentrated least square, or also profile likelihood.

Re: [R] Axes Alignment Problem for Multiple Plots

2011-04-20 Thread Matthieu Stigler
Guido You missed William's e-mails, which solved the problem: use yaxs=i in second call. Also, William made the good point that you can rather just use lines() in second call. Good William! Mat Le 20/04/2011 08:00, Barbaglia, Guido (ESA) a écrit : Dear Matthieu, thanks for your

[R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Matthieu Stigler
Hi We are about to publish a book, which contains figures made with R plots. An important detail that we did not take into account is that the book will not be printed in 4 colors (cmyk mode), but only 2 (black +spotcolor). The spotcolor we use is part of the big Pantone family. The problem

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Matthieu Stigler
export into spotcolor... Thanks! Mat Le 13/04/2011 13:41, Jim Lemon a écrit : On 04/13/2011 07:15 PM, Matthieu Stigler wrote: Hi We are about to publish a book, which contains figures made with R plots. An important detail that we did not take into account is that the book will not be printed

Re: [R] Set size of plot: in pdf() or par() ?

2011-02-23 Thread Matthieu Stigler
Dear R List Could I ask again my question about where the size of a plot should be specified (in par or pdf?). I still did not figure out, and any help would be much appreciated!! Thanks a lot! Matthieu Le 22. 02. 11 13:53, Matthieu Stigler a écrit : Hi I want to have a rectangular plot

Re: [R] Set size of plot: in pdf() or par() ?

2011-02-23 Thread Matthieu Stigler
think the problem will become apparent. best, Ista On Wed, Feb 23, 2011 at 12:39 PM, Matthieu Stigler matthieu.stig...@gmail.com wrote: Dear R List Could I ask again my question about where the size of a plot should be specified (in par or pdf?). I still did not figure out, and any help would

Re: [R] Set size of plot: in pdf() or par() ?

2011-02-23 Thread Matthieu Stigler
keeping values close to the usual ones, and then resize later one, as suggested by David (but could not find the thread mentioned). Thanks a lot to all of you! Matthieu Le 23. 02. 11 16:34, mark_diff...@yahoo.co.uk a écrit : On Feb 23, 2011; 03:32pm Matthieu Stigler wrote: I want to have

[R] Set size of plot: in pdf() or par() ?

2011-02-22 Thread Matthieu Stigler
Hi I want to have a rectangular plot of size 0.5*0.3 inches. I am having surprisingly a difficult time to do it... Since I will export it, I use also pdf(). The plot works fine, but once I specify the size in pdf() I get problems... see: Say I specify my plot as following: par(pin=c(0.5,

[R] Sweave with pdf(): how to remove mention null device

2011-01-27 Thread Matthieu Stigler
Hi I am sorry, my question seems simple and must already have been asked, but I did not find any aswser on the archives :-( I am trying to use a plot in Sweave, where I include myself the statement results=tex,echo=FALSE= pdf(plot.pdf) plot(runif(100)) dev.off()

Re: [R] Sweave with pdf(): how to remove mention null device

2011-01-27 Thread Matthieu Stigler
great, solved! Thanks a lot for your quick help! Le 27. 01. 11 11:22, Prof Brian Ripley a écrit : Note that the 'problem' is with dev.off(), not pdf(), and the answer is ?invisible. pdf() invisible(dev.off()) On Thu, 27 Jan 2011, Matthieu Stigler wrote: Hi I am sorry, my question seems

[R] error with source(): invalid 'times' value

2011-01-24 Thread Matthieu Stigler
hi I am seeing a strange behavior I can't understand... doing: source(/tmp/RFile.r,echo=TRUE) Error in rep.int(c(prompt.echo, continue.echo), c(leading, length(dep) - : invalid 'times' value traceback() 3: rep.int(c(prompt.echo, continue.echo), c(leading, length(dep) - leading)) 2:

Re: [R] error with source(): invalid 'times' value

2011-01-24 Thread Matthieu Stigler
Le 24. 01. 11 18:22, Gabor Grothendieck a écrit : On Mon, Jan 24, 2011 at 12:07 PM, Matthieu Stigler matthieu.stig...@gmail.com wrote: hi I am seeing a strange behavior I can't understand... doing: source(/tmp/RFile.r,echo=TRUE) Error in rep.int(c(prompt.echo, continue.echo), c(leading

Re: [R] error with source(): invalid 'times' value

2011-01-24 Thread Matthieu Stigler
techniques. One is to set options(error=utils::recover) so that on the error you can use the browser to examine what the values are. On Mon, Jan 24, 2011 at 12:07 PM, Matthieu Stigler matthieu.stig...@gmail.com wrote: hi I am seeing a strange behavior I can't understand... doing: source(/tmp

[R] How to move an internal function to external keeping same environment?

2010-11-15 Thread Matthieu Stigler
Hi I have within a quite big function foo1, an internal function foo2. Now, in order to have a cleaner code, I wish to have the internal foo2 as external. This foo2 was using arguments within the foo1 environment that were not declared as inputs of foo2, which works as long as foo2 is within

Re: [R] How to move an internal function to external keeping same environment?

2010-11-15 Thread Matthieu Stigler
Le 15. 11. 10 14:14, Duncan Murdoch a écrit : On 15/11/2010 7:48 AM, Matthieu Stigler wrote: Hi I have within a quite big function foo1, an internal function foo2. Now, in order to have a cleaner code, I wish to have the internal foo2 as external. This foo2 was using arguments within the foo1

Re: [R] Help on Multiple Structural break unit root test

2010-06-07 Thread Matthieu Stigler
Dear Eric This test is unfortunately AFAIK not implemented in R. You can nevertheless use the similar Zivot and Andrews test in package urca. library(urca) ?ur.za Best Matthieu Le 06. 06. 10 12:00, r-help-requ...@r-project.org a écrit : Message: 24 Date: Sat, 5 Jun 2010 15:45:29 +0100

Re: [R] Generalized DCC GARCH ML estimation

2010-06-07 Thread Matthieu Stigler
Dear Anonymous I suggest you to have a look on the code in package ccgarch, which might help you in seeing how this have been done. A useful information would be to know what kind of optimization algorithm the authors use. best Matthieu Le 07. 06. 10 12:00, r-help-requ...@r-project.org a

Re: [R] using RKWard for a function plot

2010-03-19 Thread Matthieu Stigler
Not that I know, you should write the function yourself: g-1 f-2 beta-1 curve((-2*g*x*exp(-(x^ 2)/beta)/f)) But yes the idea to add such functionality within rkward is good :-) Hope this helps Mat Is it possible to use the RKWard GUI to just plot a function? I will have some exponential

[R] [R-pkgs] Version 1.4.7 of package vars

2010-03-02 Thread Matthieu Stigler
.=vcovHC, boot=TRUE) Best Matthieu Stigler ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
other solution? Maybe there is something much simpler I'm missing:-( Thanks a lot!!! Matthieu Stigler __ 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.org/posting

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
, Matthieu Stigler matthieu.stig...@gmail.com mailto:matthieu.stig...@gmail.com wrote: Hi My goal is to do a (multiple) regression, just knowing that my Y variables will be the say k first variables of a matrix/data frame. I thought I should do it with eval(parse)) but encounter

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
, 2009 at 8:56 AM, Matthieu Stigler matthieu.stig...@gmail.com mailto:matthieu.stig...@gmail.com wrote: Thanks for answering so fast!! lm(freeny) :-) Ok that's working for the one equation case :-) Was example case... But now I want to have not only first column

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
Yes, was wondering that other code line did not change so much :-) Thanks a lot! 2009/11/30 Gabor Grothendieck ggrothendi...@gmail.com: On Sun, Nov 29, 2009 at 9:16 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: By the way, if you really do want to create the formula anyways then:

[R] Include manually an intercept in lm without breaking it?

2009-11-28 Thread Matthieu Stigler
manually an intercept and preserving the right output... any idea? Thanks a lot!! Matthieu Stigler __ 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.org/posting-guide.html

Re: [R] Include manually an intercept in lm without breaking it?

2009-11-28 Thread Matthieu Stigler
! Matthieu Duncan Murdoch a écrit : On 28/11/2009 10:14 AM, Matthieu Stigler wrote: Hi Say I want to add manually an intercept in the function lm. Even if almost all results will be identical, few stats are different as DF counting will be different as intercept will not be included in automatic

[R] rattle(): unable to load shared library

2009-11-25 Thread Matthieu Stigler
? Thanks!! Matthieu Stigler __ 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.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] [R-pkgs] Version 0.7 of package tsDyn, nonlinear time series

2009-07-27 Thread Matthieu Stigler
, suggestions and bug reports are sure welcome! Matthieu Stigler ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org mailing list https

Re: [R] R CMD check detects parse error, but in which file?

2009-03-04 Thread Matthieu Stigler
Jim Lemon a écrit : Matthieu Stigler wrote: Hello I looked on the archives but did not find answer for that... Running R CMD check for a package, i get an error: Error in parse(n = -1, file = file) : unexpected symbol at 3341: } But how can I find which file is guilty? What is this 3342

[R] R CMD check detects parse error, but in which file?

2009-03-03 Thread Matthieu Stigler
is to source() every file until I find the file where the problem is... Is there some better way to do it? With a debuger? thanks a lot! Matthieu Stigler __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

2009-01-21 Thread Matthieu Stigler
by Duncan work also, nice! I agree with you Duncan, it is not a big problem, and doesn't need at all priority, but mentioning it is maybe worth in the doc, especially if this could avoid someone to lose those two hours I lost with this Thanks to all you both! Duncan Murdoch a écrit : Matthieu Stigler

[R] Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

2009-01-20 Thread Matthieu Stigler
Hello I think there is a conflict between setwd() and \SweaveOpts{prefix.string=}. In the same document, those both command get Sweave confuse the files and directories. See: say my .Rnw document is in File1 If one inserts some setwd() for another file: -setwd(File2) then the command

Re: [R] Using fortran code which call LAPACK subroutines

2009-01-15 Thread Matthieu Stigler
Prof Brian Ripley a écrit : On Tue, 13 Jan 2009, Charles C. Berry wrote: On Tue, 13 Jan 2009, Matthieu Stigler wrote: Hello I'm trying to run a fortran code which use LAPACK subroutines. I think I should use some points shown in the manual 5.5 Creating shared objects but it is too

[R] Using fortran code which call LAPACK subroutines

2009-01-13 Thread Matthieu Stigler
Hello I'm trying to run a fortran code which use LAPACK subroutines. I think I should use some points shown in the manual 5.5 Creating shared objects but it is too technical for me :-(... Could anyone help me for the procedure to do: -which part of the manual is relevant for this type of

[R] Rr: For and if confusion

2008-12-18 Thread Matthieu Stigler
I have two date objects X - c(01-03-1993, 01-05-1997) #Mar 1993 and May 1997 Y - c(01-02-1995, 01-08-1999) #Feb 1995 and Aug 1999 and a time series object A - ts(rnorm(120), freq=12, start=c(1992,8)) #Aug 1992 to Aug 2002 I want to create a binary (0-1) vector B that is of length 1:(A).

[R] arima.sim and first innovation: why nevertheless assume 0?

2008-11-14 Thread Matthieu Stigler
one is zero, now compute the second one: 0+e[3]+e[2]*0.5 #and this is not what the arima.sim gives... Is my reasonning correct? How to explain that the first value is zero? Hos is the series constructed? And why does it returns n+1 values? Thank you for your help! Matthieu Stigler

Re: [R] Pkg rgl: installation fails because of x11

2008-10-29 Thread Matthieu Stigler
Ben Bolker 2008/10/27 Duncan Murdoch [EMAIL PROTECTED] Matthieu Stigler wrote: Hello Im trying to install package rgl in a freshly installed Ubuntu 8.04 system. I have a problem (actually is has been reported three times on the R-list but the answers were too complicated for me) when

[R] Pkg rgl: installation fails because of x11

2008-10-27 Thread Matthieu Stigler
Hello Im trying to install package rgl in a freshly installed Ubuntu 8.04 system. I have a problem (actually is has been reported three times on the R-list but the answers were too complicated for me) when installing: configure: using libpng dynamic linkage checking for X... no configure: error:

[R] Sweave from Kile

2008-10-13 Thread Matthieu Stigler
Hello Does anybody have experience with Sweave run from Kile? I'm trying to make it run but have problems and don't know if the instructions are false or I do something wrong (my knowledge in bash and shell is too low to understand it)... I discovered recently Sweave and wanted to run it

[R] [Solved] Re: Sweave from Kile

2008-10-13 Thread Matthieu Stigler
Thanks to the help of Gregor Gorjanc I could solve the problem: 1: With the command sudo chmod a+x /usr/local/bin/Sweave.sh I had only ls -l /usr/local/bin/Sweave.sh -rwxr-x--x 1 root root 29997 2008-10-11 15:42 /usr/local/bin/Sweave.sh So I added sudo chmod o+r /usr/local/bin/Sweave.sh

Re: [R] Threshold vector error correction models

2008-08-13 Thread Matthieu Stigler
Hello I worked on threshold cointegration for my master thesis and wrote code for R. This code will be published in a next release of package tsDyn, when I will have time to finish it (there is a difference between using its own code and making it avalaible on R... I did'nt realize there is

Re: [R] Optimal lag selection in Granger Causality tests

2008-07-02 Thread Matthieu Stigler
See function VARselect() in package vars which computes AIC and BC for each lag function ar() also computed VAR models with automatic selection of lags Mat First of all, I was not aware of the RSiteSearch function. Cool. Thanks for that. That having been said, I could not find anything

Re: [R] Which distribution best fits the data?

2008-07-01 Thread Matthieu Stigler
Hello Regressions with time series model is something more complicate than usual, I recommend you to read more about it in any time series manual. The biggest problem comes from the so called potential spurious regression, that is your regression can lead to errnoneous conclusions (if you

[R] Documentation about htest?

2008-06-23 Thread Matthieu Stigler
Hello I saw in many packages and functions a class htest. I wanted to study it and maybe use for a package instead of writing new classes, but did not find any documentation about this class in the official manuals. Are there some information available about it? How can I see how to use it?

Re: [R] using spec.pgram

2008-06-10 Thread Matthieu Stigler
Hello I don't know exactly what you want to do but: -why do you use in your example h$counts and not h? Furthermore helpl file says it should be a time series, why then rather not your time series? -usually na.action will make the default action, which you can see by getOptions(na.action)

Re: [R] Non-linearity with Parametric data

2008-04-15 Thread Matthieu Stigler
Hello Are you working with parametric (your title) or non-parametric (your text) data? And what type of data (time series?)? Finally what kind of non-linearities are you interested in? Non-linear regression models (threshold autoregression, smooth transition, ANN) are avalaible in package

Re: [R] Problems with Unit Root testing using ur.df function

2008-04-04 Thread Matthieu Stigler
Matthieu Stigler a écrit : Hi All, I'm new to R and am trying to run a unit root test on the vector y (a time series of inflation (i.e. changes in the Consumer Price Index quarter on quarter)). I've run the Augmented-Dickey-Fuller Test below (R's URCA package). It gives me an error

[R] How to include an externally defined NULL value in lm

2008-03-03 Thread Matthieu Stigler
Hello! I would love to be able to include an external variable to a lm call, I mean something: if(TRUE) a-freeny.x[,4] else a-NULL lm(freeny.y~freeny.x[,-4] +a) but it does not work with a-NULL, whereas lm(freeny.y~freeny.x[,-4] +NULL) I don't understand why and did not find an

[R] Number of digits of a value for problem 7.31 RFAQ

2008-02-18 Thread Matthieu Stigler
Hello dear R users! I did not find a function which gives information about the number of digits of a value shown by R. Do you know one? I need it to solve the problem (see RFAQ 7.31)that 0.2==0.2+0.1-0.1 FALSE The solution suggested in RFAQ is to use isTRUE(all.equal(0.2,0.2+0.1-0.1)) But if

Re: [R] Number of digits of a value for problem 7.31 RFAQ SOLVED

2008-02-18 Thread Matthieu Stigler
[EMAIL PROTECTED] a e'crit : What I mean is if R shows 2.3456 I want to obtain the info that digits=4 even if in facts the value has more (internal) digits. Try: x = 1.23456789 format(x, nsmall=20) # [1] 1.2345678899989009 I've just re-read the question. I

Re: [R] Number of digits of a value for problem 7.31 RFAQ SOLVED not really

2008-02-18 Thread Matthieu Stigler
Matthieu Stigler a e'crit : [EMAIL PROTECTED] a e'crit : What I mean is if R shows 2.3456 I want to obtain the info that digits=4 even if in facts the value has more (internal) digits. Try: x = 1.23456789 format(x, nsmall=20) # [1] 1.2345678899989009 I've just re-read the question

[R] Grid search: avoid for loops thanks to applyco?

2008-01-28 Thread Matthieu Stigler
Hello I'm trying to implement a grid search for a threshold autoregressive model, it is a model in which the regression coefficients are different according to the regimes (under the lower threshold, between lower and upper, over the upper threshold). Estimation of the threshold is made with