[R] Loop: noob question

2011-08-05 Thread UnitRoot
Hi,
Can someone help me out to create a (for?) loop for the following procedure:

x=rnorm(250,0,0.02)
library(timeSeries)   
x=timeSeries(x)  
P=1000 
loss=-P*x  
loss  
v95=quantile(loss,0.95)
v95

I would like to generate 100 000 v95 values.
Also, can anybody name a source where I could read up basic programming in
R?
Thank you.

--
View this message in context: 
http://r.789695.n4.nabble.com/Loop-noob-question-tp3721500p3721500.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Using ts and timeSeries

2011-06-15 Thread UnitRoot
Hello. I have been working on a project which involves random number
generation and unit root test. After I generate the numbers (I am generating
stock returns using rnorm(1000,0,0.25),  I want to check if the series has a
unit root or not. But before I should modify the data to time series. My
question is which of the functions ts or timeSeries more appropriate to test
unit root using Augmented Dickey Fuller test?
Thank you.

--
View this message in context: 
http://r.789695.n4.nabble.com/Using-ts-and-timeSeries-tp3598693p3598693.html
Sent from the R help mailing list archive at Nabble.com.

__
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] How to fit ARMA model

2011-07-01 Thread UnitRoot
Hello,
I am having some problems with fitting an ARMA model to my time series data
(randomly generated numbers). The thing is I have tried many packages
[tseries, fseries, FitARMA etc.] and all of them giving very different
results. I would appreciate if someone could post here what the best package
is for my purpose. 
Also, after having done the fitting, I would like to check for the model's
adequacy. How can I do this?
Thanks.

--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-fit-ARMA-model-tp3637632p3637632.html
Sent from the R help mailing list archive at Nabble.com.

__
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] How to generate heteroscedastic random numbers?

2011-07-08 Thread UnitRoot
Hello,
I have tried to generate numbers randomly which follow normal, Student-t and
skewed Student-t distributions. However, when I check those series for
heteroscedastisity test (ARCH) results are showing that there is no
heteroscedastisity.
As we all know, returns (financial returns) usually have heteroscedastisity.
My question is, is it possible somehow generate random numbers which have
hetescedastisity?
I was thinking about generating random numbers and sort them out and then
allocate them, so they will have some level of heteroscedastisity. However,
I am not sure if this is correct way of doing it.
I appreciate any input. Thank you.

--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-generate-heteroscedastic-random-numbers-tp3654534p3654534.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Strange graphs

2011-07-18 Thread UnitRoot
Hello,
I am facing problems with plotting graphs in R. It was working well since
today, but I cannot get some graphs for unknown reasons. Initially it gave
me diagonal straight lines. Now it is giving me very strange curves.  I have
tried to re-install the softwear. It still did not help.

Please, help me out. Oh, I am using fGarch package outputs and based on them
trying to plot the graphs. I do not know if it is because of the package
that I am using.

Thank you.

--
View this message in context: 
http://r.789695.n4.nabble.com/Strange-graphs-tp3675530p3675530.html
Sent from the R help mailing list archive at Nabble.com.

__
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.