[R] Number of used observations in stats::arima with NAs

2016-11-02 Thread Javier López-de-Lacalle via R-help
g" is not NULL, "dx" is required in other part of the code, so it is convenient to use it here as well; replacing "x" by "dx" and "xreg" by "dxreg": isna <- is.na(dx) | apply(dxreg, 1L, anyNA) n.used <- sum(!isna) Are there any reaso

[R] Function StructTS: covariance matrix of the initial state vector

2014-11-05 Thread Javier López-de-Lacalle
Hi everyone: My question is about the function "StructTS" of the core package "stats", which fits by maximum likelihood the basic structural time series model. According to theory and the references given in "?StructTS", the covariance matrix of the initial state vector is a diagonal matrix. Ho

[R] Extract the names of the arguments in an "expression"

2011-03-24 Thread Javier López-de-Lacalle
Hi everybody: I need to get the names of the arguments in an object of class "expression". I've got the following expression: > x <- expression(rho * cos(omega)) Is there any function or procedure that returns the names of the arguments (in the example: "rho" and "omega")? I tried a rough appro

[R] How to call to R_KalmanLike from outside StructTS

2010-09-10 Thread Javier López-de-Lacalle
Dear all: I want to modify the 'StructTS' function from the 'stats' package. First, I am writing a working copy of the original version and got some problems. I have two versions of the function plus the original one. The first version is the same code as the 'StructTS' function: StructTS.v1 <