allan clark <[EMAIL PROTECTED]> writes:
> hi all
>
> how does one simulate a random walk process?
>
> i.e
>
> y(0)=0
>
> y(t)=y(t-1)+ e(t)
>
> where e(t) is normal(0,1) say.
E.g.,
c(0,cumsum(rnorm(1000)))
--
O__ Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Bi
Dear Alan,
Perhaps there's a more clever solution, but the following will work and
follows directly from your statement of the problem (e.g., for 100
observations):
e <- rnorm(100)
y <- rep(0, 101)
for (t in 2:101) y[t] <- y[t-1] + e[t]
y <- y[-1]
I hope that this helps,
John
On Tue, 10 Feb 20
On Tue, 10 Feb 2004, allan clark wrote:
> hi all
>
> how does one simulate a random walk process?
>
> i.e
>
> y(0)=0
>
> y(t)=y(t-1)+ e(t)
>
> where e(t) is normal(0,1) say.
>
e<-rnorm(100)
y<-cumsum(e)
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
[EMAIL PROT
> how does one simulate a random walk process?
>
> i.e
>
> y(0)=0
>
> y(t)=y(t-1)+ e(t)
>
> where e(t) is normal(0,1) say.
cumsum(c(0,rnorm(1)))
?
Claus
--
*
Claus Thorn Ekstrøm <[EMAIL PROTECTED]>
Dept of Mathematics and Physics, KVL
Thorvaldse
How about:
y<-cumsum(c(0,rnorm(100)))
On Tue, 10 Feb 2004, allan clark wrote:
> hi all
>
> how does one simulate a random walk process?
>
> i.e
>
> y(0)=0
>
> y(t)=y(t-1)+ e(t)
>
> where e(t) is normal(0,1) say.
>
> Regards
> allan
>
__
[EMAIL PRO
inal Message-
From: allan clark [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 14:48
To: Rhelp
Subject: [R] R: lags
hi all
how does one simulate a random walk process?
i.e
y(0)=0
y(t)=y(t-1)+ e(t)
where e(t) is normal(0,1) say.
Regards
allan
KSS Ltd
Seventh Floor St James's Bui
hi all
how does one simulate a random walk process?
i.e
y(0)=0
y(t)=y(t-1)+ e(t)
where e(t) is normal(0,1) say.
Regards
allan
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
> "allan" == allan clark <[EMAIL PROTECTED]>
> on Tue, 03 Feb 2004 13:57:53 +0200 writes:
allan> Hi all I want to calculate certain lags of a time
allan> series and plot them simultaneously on a graph. can
allan> anyone help?
Use lag.plot() {name and part of UI is for S+
On Tue, 03 Feb 2004 13:57:53 +0200 allan clark wrote:
> Hi all
>
> I want to calculate certain lags of a time series and plot them
> simultaneously on a graph. can anyone help?
Something like this?
R> x <- ts(cumsum(rnorm(20)), start = 0, freq = 10)
R> plot(x)
R> lines(lag(x, k = -1), col = 4)
?lag.plot
-Original Message-
From: allan clark [mailto:[EMAIL PROTECTED]
Sent: 03 February 2004 11:58
To: Rhelp
Subject: [R] R: lags and plots
Hi all
I want to calculate certain lags of a time series and plot them
simultaneously on a graph. can anyone help?
KSS Ltd
Seventh Floor
Consider the following:
plot(1:9, (1:10)[-1])
lines(1:9, (1:10)[-10])
Does this help?
spencer graves
allan clark wrote:
Hi all
I want to calculate certain lags of a time series and plot them
simultaneously on a graph. can anyone help?
Hi all
I want to calculate certain lags of a time series and plot them
simultaneously on a graph. can anyone help?
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-pr
12 matches
Mail list logo