Displaying 20 results from an estimated 4000 matches similar to: "avoid loop with three-dimensional array"
2006 Oct 13
3
Rmpi performance
Dear R users,
we are trying to do some parallel computing using library(snow).
In particular we have a cluster with 3 nodes
>cl <- makeCluster(3, type = "MPI")
3 slaves are spawned successfully. 0 failed.
and we want to compute the function op_mat (see below) first with the
master and then with the cluster using system.time for checking the
computational performance.
2006 Apr 04
2
EM algorithm
Dear R-Users,
I have a model with a latent variable for a spatio-temporal process.
I would like to use EM algorithm to estimate the parameters.
Does anybody know how to implement the algorithm in R?
Thank you very much in advance,
Michela
2006 Nov 23
2
loading libraries on MPI cluster
Dear R-users,
we are using library(snow) for computation on a linux cluster with RMPI.
We have a problem with clusterEvalQ: after launching clusterEvalQ it seems
loading the required library on each node but if we type a function
belonging to the loaded package R doesn't find it.
> library(snow)
# making cluster with 3 nodes
> cl <- makeCluster(3, type = "MPI")
Loading
2018 Jan 17
1
mgcv::gam is it possible to have a 'simple' product of 1-d smooths?
I am trying to test out several mgcv::gam models in a scalar-on-function regression analysis.
The following is the 'hierarchy' of models I would like to test:
(1) Y_i = a + integral[ X_i(t)*Beta(t) dt ]
(2) Y_i = a + integral[ F{X_i(t)}*Beta(t) dt ]
(3) Y_i = a + integral[ F{X_i(t),t} dt ]
equivalents for discrete data might be:
1) Y_i = a + sum_t[ L_t * X_it * Beta_t ]
(2) Y_i
2007 Mar 19
1
data.frame handling
Dear R-users,
I have a little problem that I can't solve by myself.
I have a data frame with 2 factors and 8 observations (see the following
code):
y <- c(1,1,1,2,2,3,3,3)
y <- factor(y)
levels(y) <- c("a","b","c")
x <- c(1,2,3,1,2,1,2,3)
x <- factor(x)
levels(x) <- c("x","y","z")
X <-
2007 May 08
2
statistics/correlation question NOT R question
This is not an R question but if anyone can help me, it's much
appreciated.
Suppose I have a series ( stationary ) y_t and a series x_t ( stationary
)and x_t has variance sigma^2_x and epsilon is normal
(0, sigma^2_epsilon )
and the two series have the relation
y_t = Beta*x_t + epsilon
My question is if there are particular values that sigma^2_x and
sigma^2_epsilon have to take in
2000 Apr 04
0
stochastic process transition probabilities estimation
Hi all,
I'm new with R (and S), and relatively new to statistics (I'm a
computer scientist), so I ask sorry in advance if my question is silly.
My problem is this: I have a (sample of a) discrete time stochastic
process {X_t} and I want to estimate
Pr{ X_t | X_{t-l_1}, X_{t-l_2}, ..., X_{t-l_k} }
where l_1, l_2, ..., l_k are some fixed time lags. It will be enough for
me to compute
2007 Sep 13
5
statistics - hypothesis testing question
I estimate two competing simple regression models, A and B where the LHS
is the same in both cases but the predictor is different (
I handle the intercept issue based on other postings I have seen ). I
estimate the two models on a weekly basis over 24 weeks.
So, I end up with 24 RSquaredAs and 24 RsquaredBs, so essentally 2 time
series of Rsquareds. This doesn't have to be necessarily thought
2017 Jun 20
1
How to write an estimated seasonal ARIMA model from R output?
I'm trying to use the following command.
arima (x, order = c(p,d,q), seasonal =list(order=c(P,D,Q), period=s)
How can I write an estimated seasonal ARIMA model from the outputs. To be specifically, which sign to use? I know R uses a different signs from S plus.
Is it correct that the model is:
(1-ar1*B-ar2*B^2-...)(1-sar1*B^s-sar2*B^2s-....)(1-B)^d(1-B^s)^D
2007 Jul 06
1
algebra/moving average question - NOTHING TO DO WITH R
This has ABSOLUTELY nothing to do with R but I was hoping that someone
might know because there are obviously a lot of very bright people on
this list.
Suppose I had a time series of data and at each point in time t, I was
calculating x bar + plus minus sigma where x bar was based on a
moving window of size n and so was sigma.
So, if I was at time t , then x bar t plus minus sigma_t would be
2007 May 21
1
Sample correlation coefficient question NOT R question
This is a statistics question not an R question. When calculating the
sample correlation coefficient cor(x_t,y_t) between say
two variables, x_t and y_t t=1,.....n ( one can assume that the
variables are in time but I don't think this really matters
for the question ), does someone know where I can find any piece of
literature that says that each (x_j,y_j) pair has
To be independent from the
2006 Feb 06
1
marginal distribution wrt time of time series ?
Dear all,
In many papers regarding time series analysis
of acquired data, the authors analyze 'marginal
distribution' (i.e. marginal with respect to time)
of their data by for example checking
'cdf heavy tail' hypothesis.
For i.i.d data this is ok, but what if samples are
correlated, nonstationary etc.?
Are there limit theorems which for example allow
us to claim that
2007 Mar 05
1
Heteroskedastic Time Series
Hi R-helpers,
I'm new to time series modelling, but my requirement seems to fall just
outside the capabilities of the arima function in R. I'd like to fit an
ARMA model where the variance of the disturbances is a function of some
exogenous variable. So something like:
Y_t = a_0 + a_1 * Y_(t-1) +...+ a_p * Y_(t-p) + b_1 * e_(t-1) +...+ b_q *
e_(t-q) + e_t,
where
e_t ~ N(0, sigma^2_t),
2007 Aug 07
1
Functions for autoregressive Regressionmodels (Mix between times series and Regression Models) ?
Hello everybody,
I've a question about "autoregressive Regressionmodels".
Let Y[1],.....,Y[n], be a time series.
Given the model:
Y[t] = phi[1]*Y[t-1] + phi[2]*Y[t-1] + ... + phi[p]*Y[t-p] + x_t^T*beta + u_t,
where x_t=(x[1t],x[2t],....x[mt]) and beta=(beta[1],...,beta[m]) and u_t~(0,1)
I want to estimate the coefficients phi and beta.
Are in R any functions or packages for
2008 Jul 22
1
help with simulate AR(1) data
Hi, sorry for bothering your guys again.
I want to simulate 100 AR(1) data with cor(x_t, x_t-1)=rho=0.3. The mean of
the first 70 data (x_1 to x_70) is 0 and the mean of the last 30 data (x_71
to x_100) is 2. Can I do it in the following way?
x <- arima.sim(list=(ar=0.3), 100)
mean <- c(rep(0, 70), rep(2, 30))
xnew <- x+mean
If the above code to simulate 100 AR(1) data is right, what
2010 Aug 13
2
How to compare the effect of a variable across regression models?
Hello,
I would like, if it is possible, to compare the effect of a variable across
regression models. I have looked around but I haven't found anything. Maybe
someone could help? Here is the problem:
I am studying the effect of a variable (age) on an outcome (local recurrence:
lr). I have built 3 models:
- model 1: lr ~ age y = \beta_(a1).age
- model 2: lr ~ age + presentation
2009 Jun 19
1
using garchFit() to fit ARMA+GARCH model with exogeneous variables
Hello -
Here's what I'm trying to do. I want to fit a time series y with
ARMA(1,1) + GARCH(1,1), there are also an exogeneous variable x which I
wish to include, so the whole equation looks like:
y_t - \phi y_{t-1} = \sigma_t \epsilon_t + \theta \sigma_{t-1}
\epsilon_{t-1} + c x_t where \epsilon_t are i.i.d. random
variables
\sigma_t^2 = omega + \alpha \sigma_{t-1}^2 + \beta
2009 Sep 21
1
Three dimensional view of the profiles using 'rgl' package (example of 3 dimensional graphics using rgl package).
Hi there,
Anyone has an idea how to put those two sets of code together so that I can get a 3-dimensional picture that includes points instead of 2 separate pictures which doesnt make that much sense at the end.
#Let's say that these are the data we would like to plot:
A<-c(62,84,53)
B<-c(64,82,55)
C<-c(56,74,41)
D<-c(46,68,38)
E<-c(71,98,72)
data<-rbind(A,B,C,D,E)
2002 Apr 09
2
Restricted Least Squares
Hi,
I need help regarding estimating a linear model where restrictions are imposed on the coefficients. An example is as follows:
Y_{t+2}=a1Y_{t+1} + a2 Y_t + b x_t + e_t
restriction
a1+ a2 =1
Is there a function or a package that can estimate the coefficient of a model like this? I want to estimate the coefficients rather than test them.
Thank you for your help
Ahmad Abu Hammour
--------------
2023 Dec 08
1
Convert two-dimensional array into a three-dimensional array.
Colleagues
I want to convert a 10x2 array:
# create a 10x2 matrix.
datavals <- matrix(nrow=10,ncol=2)
datavals[,] <- rep(c(1,2),10)+c(rnorm(10),rnorm(10))
datavals
into a 10x3 array, ThreeDArray, dim(10,2,10).
The values storede in ThreeDArray's first dimensions will be the data stored in datavalues.
ThreeDArray[i,,] <- datavals[i,]
The values storede in ThreeDArray's second