Good afternoon,
I know it is a simple question but I cannot figure out how to solve this
issue.
I have a function that calculate two objects. I would like to choose
everytime about the tree object, with default to not show it.
OP<-function(S=100,X,sigma,mu=0,r=0,time=1,n)
{
value=(S)
Hi there, I'm in desperate need to figure out how to solve this issue.
I need to estimate a recursive model for a time series data of asset
returns. The dependent variable is the asset return and then I have a set of
k variables, a lagged value of the dependent variable (plus an intercept) as
regr
done at
the moment
betas<-read.table("C:\\Users\\Manta\\Desktop\\betas.txt",header=T,dec=",")
BETA<-ts(betas,start=(1984),frequency=12)
BETAS<-TSdata(output=BETA)
VAR1<-estVARXls(window(BETAS,end=c(2003,12)),max.lag=1)
pr<-forecast(VAR1,horizon=1)
pr3<-foreca
I have the following daily exchange rate series (from january 1st 1996 to
december 31st 2008) and I want to obtain them monthly series from it. I've
read about the 'zoo' library but I'm not getting it how to do it. These are
the data (left column day-month-year, right column the index)
31/12/199
Ok, thanks for the quick reply.
I was not able to use the first command, but reading the quick reference
helped me.
Here's what I did.
> cambio<-read.zoo("C:\\Users\\Manta\\Desktop\\useuro.txt", format =
> "%d/%m/%Y", dec = ",",header=T)
> cambio #t
Ok, using
mcambio <- aggregate(cambio, as.yearmon, mean)
works perfectly!! Should I worry about the missing values or not anyway? And
then I go to the following question. From monthly data to daily using a
specific formula?
--
View this message in context:
http://www.nabble.com/From-daily-seri
Ok, I'll try to explain my issue. I have a monthly series (CPI index) and I
want to interpolate it using a specific lagged harmonized formula to get the
corresponding daily series. The formula is the following
CPI^=CPI(t-3)+(d-1)/D*(CPI(t-2)-CPI(t-3))
where
CPI^ is the CPI for the day we are ca
any update anybody? I'm really stucked!
--
View this message in context:
http://www.nabble.com/From-daily-series-to-monthly-and-viceversa-tp23064454p23103052.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
; z3$day.of.month <- as.numeric(format(time(zz2), "%d"))
> # now each row of z3 has all the data you need so apply(z3, 1,
> your.function)
>
>
> On Fri, Apr 17, 2009 at 2:13 PM, manta wrote:
>>
>> any update anybody? I'm really stucked!
>> --
&g
Thanks so much
--
View this message in context:
http://www.nabble.com/From-daily-series-to-monthly-and-viceversa-tp23064454p23116875.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.e
Dear all,
I have two series of returns and I want to find the cross-correlations
between these two series. I know of the ccf, but it does not work as I'd
like
if i type
ccf(x,y,lag.max=20,type="correlation",plot=FALSE)
i got the error message
Error in na.fail.default(ts.intersect(as.ts(x), as.t
??
--
View this message in context:
http://www.nabble.com/Cross-Correlation-function-%28CCF%29-issues-tp23145411p23156769.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/l
Sorry, my bad, i did not mean to 'be mean'.
Here are the first five observations for three variables (dr1, dr2 and doil)
dr1
1996-01-021996-01-031996-01-041996-01-051996-01-08
0.0005814396 -0.0023725000 -0.0072835915 0.0074536448 -0.0007004221
dr2
1996-01-031996-01-0
you experiencing? It looks as though
> your method of differencing (whatever it was) offset the date
> registration of the zoo series in dr2, but ccf(do1, dr2) still does
> not appear to choke on that input.
>
> --
> David
>
> On Apr 21, 2009, at 4:06 PM, manta wro
the tiny sample objects that I created from your dput output, then I
> don't have an answer, since there were no missing values in those
> objects.
>
> --
> David Winsemius
>
>
> On Apr 21, 2009, at 5:21 PM, manta wrote:
>
>>
>> This is what I get.
&g
(as I
> remember) you wantted to know why the result was so short. Why not put
> in a full working example with an extract of the data. Suggest you try
> using dput as a method of creating a working example. That way we (and
> the R interpreter) would get labels and class in
Dear All,
I have a large data set that looks like this:
CVX 20070201 9 30 51 73.25 81400 0
CVX 20070201 9 30 51 73.25 100 0
CVX 20070201 9 30 51 73.25 100 0
CVX 20070201 9 30 51 73.25 300 0
First, I would like to import it by merging column 3 4 and 5, since that is
the timestamp. Then, I would l
Dear all,
I have a problem which I'm not to fix. I have the following two series:
a=structure(c(33242.5196150509, 34905.8434338503, 38490.6957848689,
38747.0287172129, 38919.1028597142, 39026.3956586941, 38705.5344288997,
38545.6274379387, 38651.2079354205, 38748.2769580121), index =
structure(
Dear all,
I have a dataset with one column being of class Date. When I write the
output, I would like that column being written as number of days from
1970-01-01. I could not find anywhere a way to do it.
Thanks,
Marco
--
View this message in context:
http://r.789695.n4.nabble.com/Write-date-
Dear all,
I have a large vector of durations (in seconds) and I create an histogram as
follows:
hist(durations,breaks=500,xlim=c(0,2000),main="",xlab="Duration
(Seconds)",ylab="Frequency (%)",prob=TRUE)
Next, I would like to superimpose the exponential distribution with the
maximum likelihood es
Cant believe it was that
--
View this message in context:
http://r.789695.n4.nabble.com/Superimpose-exponential-density-function-to-histogram-tp4666468p4666480.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mai
Dear R users,
I may have found a bug in the function 'data.table'. I have a similar
question as the one in this post:
http://stackoverflow.com/questions/3367190/aggregate-and-weighted-mean-in-r
I have a dataset with assets, quantity traded, date and time. I would like
to calculate the value weig
As somebody else replied (but for some reason did not get through it) the
solution to this is to convert the variable TIME3 from POSIXlt to POSIXct.
It works like a charm.
Nevertheless, there is a bug in that R should give me a warning/error
message, and not simply crash. I reported the bug to the
Hi all,
I have a vector of numbers, and to be able to pass it to RMySQL and use the
IN clause I need to have this vector to be a single list numeric and comma
separated.
I saw the post below but it is about strings, which I do not need (I cannot
pass strings in this SQL query, I need something li
Dear R community,
I am struggling a bit with a probably fairly simple task. I need to use some
already existing functions as argument for a new function that I am going to
create. 'dataset' is an argument, and it comprises objects named
'mean_test', 'sd_test', 'kurt_test' and so on. 'arg1' tells
Thaks for your quick reply Bert, although I doubt it works.
The reason is that the names of the objects of the dataset, all end with the
sufix '_test' and therefore I need to attach/paste/glue this suffix to the
'arg2' of the function. Any other idea?
--
View this message in context:
http://r.7
Dear R users, I have the following script to create bins of specified time
intervals
bin_end=60/bin_size
bin_size=bin_size*100
h=seq(07,18,by=1)
breaks=c()
for (i in h)
{
for (j in 0:(bin_end-1))
{
value=i+(bin_size)*j
b
David Winsemius wrote:
>
>
> You seen to be under the mistaken impression that the internal
> representation of DateTime classes of 08:00 would be 8. Since the
> internal representation of time is in seconds, the even number hours
> would be at integer multiples of 60*60. In addition
I do not think that importing the time as character will help me, as I need
to perform several operation with them. Again, maybe I am not able to
express clearly enough. Let's just focus on this series:
> breaks
[1] 7 71500 73000 74500 8 81500 83000 84500 9 91500
93000 94
Thanks Phil, it is exactly what I was looking for.
David, I took into account how to make valid math operations, so I
understand your concern about it.
I will definitely change all my scripts and functions to considered the time
as character, but as I need a clear output soon (deadline is close)
Sorry R community, I am still stucked wit this. How can avoid the x-limit
error?
--
View this message in context:
http://r.789695.n4.nabble.com/Chron-object-in-time-series-plot-tp3002285p3004070.html
Sent from the R help mailing list archive at Nabble.com.
__
Well, I was listening, but the error was due to the extra function 'format'.
Without that, it works perfectly.
Thanks for the help,
Marco
--
View this message in context:
http://r.789695.n4.nabble.com/Chron-object-in-time-series-plot-tp3002285p3004177.html
Sent from the R help mailing list arch
I would like to thank you all for the help given so far!
I have the following object of the class 'zoo'
> temp_mean_plot[31:35]
2008-02-13 2008-02-14 2008-02-15 2008-02-18 2008-02-19
14.86834 14.89609 14.89358 14.87610 14.87652
The sample runs from Jan 2008 to July 2010. How can I sp
My bad! What I meant is that I want to plot the whole series, but the legend
in the x-axis would only present some specific months depending on the
window I want to choose, say 6 months. At the moment, it only present 2008,
2009 and 2010.
Thanks
--
View this message in context:
http://r.789695.
I apologize for not being very precise. I meant the tick marks on the x-axis.
As for the code, the situation is just the one describe above, just that I
would like to be able to specify the tick marks (say every 3 or 6 months).
--
View this message in context:
http://r.789695.n4.nabble.com/Chro
Wonderful!
Thanks a lot for your help, super appreciated!
--
View this message in context:
http://r.789695.n4.nabble.com/Chron-object-in-time-series-plot-tp3002285p3012793.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-proj
Thanks for your help Gabor. That would be exactly what I am looking for. If I
use your code I get the nice representation I am looking for. However, when
I try to apply the code in the same fashion to my case, it does not produce
the x-axis. I believe the problem hinges on the following warning me
Ok, so you may be right, but I do not understand why ;)
The commands you suggested are applied to temp_plot, where temp_plot is a
'zoo' object as follows (there is actually something strange in here, if I
just want to see the whole object I do not get the warning message that I
got when selecting
This is the output, thanks again for the help!
structure(c(48608, 46686, 55216, 59268, 50967, 55067, 57783,
60021, 61480, 63853, 58267, 72442, 63926, 49102, 74320, 63433,
...
55337, 54919, 63230, 57756, 80296, 58319, 56993, 59161, 56184,
65331, 56179, 61115, 59874, 85050), index = structure(li
Here it is:
dput(temp_plot)
structure(c(48608, 46686, 55216, 59268, 50967, 55067, 57783,
60021, 61480, 63853, 58267, 72442, 63926, 49102, 74320, 63433,
66256, 68483, 67736, 60507, 60888, 78008, 64326, 65665, 57288,
54663, 54984, 54073, 59632, 52523, 55266, 54836, 61408, 53813,
85855, 65204, 6
And how about if I want to order the series from the smallest to the largest
value, keeping the date index in order to see when the values were
predominantly negative etc...
Thanks,
Marco
--
View this message in context:
http://r.789695.n4.nabble.com/Ordeing-Zoo-object-tp955868p3054192.html
Sen
Dear R community, I have the following two zoo objects:
MONTHLY CPI
> plot(z)
> par("usr")
[1] 1977.76333 2011.15333 70.39856 227.03744
> z=zooreg(cpius$Value,as.yearmon("1979-11"),frequency=12)
> str(z)
‘zooreg’ series from Nov 1979 to Oct 2010
Data: num [1:372] 76.2 77 77.8 78.5 79.5 80.3
Thanks as always Gabor.
What I was looking for was to plot the daily series on the same graph of the
monthly using the command 'lines'. That is why I wanted to change the index
of one of the two, as it seems the reason why at the moment it is not
working!
--
View this message in context:
http:/
Ok this helps definitely! But I still would like to know
1. How to change from one index to another within a 'zoo' object
2. How to import using as index 'Date' a monthly series (code below). The
series in the US CPI from November 1979 to October 2010.
z <- zoo(cpius$Value, as.Date("1979-11-30")
Gabor Grothendieck wrote:
>
>> 2. How to import using as index 'Date' a monthly series (code below). The
>> series in the US CPI from November 1979 to October 2010.
>>
>> z <- zoo(cpius$Value, as.Date("1979-11-30")+0:372)
>
> Assuming the question is how to turn this daily series into a monthly
Gabor Grothendieck wrote:
>
> How to convert a monthly series to a daily series has already been
> illustrated in multiple ways in this thread.
>
Fair enough. However, my last question was different. I simply want to know
if there is a simple neat way to import a monthly series as a zoo object
Dear all,
I am facing a problem. I am trying to install packages using a proxy, but I
am not able to call the setInternet2 function, either with the small or
capital s. What package do I have to call then? And, could there be a reason
why this does not function?
Thanks,
Marco
--
View this messa
It says the function does not exist. The version is around 2.8, cant check
right now. Is it because it's an older version? If so, is there any way to
do it in a different way then?
--
View this message in context:
http://r.789695.n4.nabble.com/SetInternet2-RCurl-and-proxy-tp3248576p3330244.html
Dear all,
I am not able to draw a 45 degrees line in a zoo plot. The time index is a
sequence of 15 min bins from 7 in the morning to 18:45 in the evening.
Thanks,
Marco
--
View this message in context:
http://r.789695.n4.nabble.com/45-degress-line-in-zoo-plot-tp3839182p3839182.html
Sent from t
I have a similar problem. I have a dataset and an element. If the element is
equal to "YY", I want to take the first column of the dataset, otherwise I
want to take the second column. The following does not work, as it only
evaluates the first element. Any idea?
a=c("AAAXXX","BBBXXX")
a=merge(a,c(
Dear all,
I know this may have been already discussed, but I could not find a
solution.
I am using R 13.2 64 bit on a 64 bit machine dual core. I'm fitting a Cox
proportional model to a matrix 1e06x7. Before starting the model fitting I
set memory.size(max=1) and I do a clean of the garbage c
Dear Uwe,
many thanks for your message. To reply to your questions, as you imagined I
cannot provide a reproducible example. In addition, I cannot expand the
memory, as I'm working on a virtual desktop. At any rate, the program is
really on 'standstill' as the memory usage is flat and does not mov
It was already done, as I reduced the dataset at the minimum I could. I
really need to solve this issue somehow.
--
View this message in context:
http://r.789695.n4.nabble.com/R-for-windows-64-bit-tp1011346p4289419.html
Sent from the R help mailing list archive at Nabble.com.
___
Dear all,
another questions related to zoo plotting. I would like to do as in the
subject. Here a reproducible code:
library(zoo)
par(mfrow=c(2,1)
plot(zoo(seq(1:10),as.Date(seq(1:10),origin="1970-01-01")),xlab="",ylab="",main="Value",las=1)
mtext("EUR billions",adj=0,cex=0.7)
plot(zoo(seq(1:10),
Thanks, although I still have a couple of questions:
1. What is the line parameter? I could not find it in the manual...
2. How does exactly work the adj parameter when giving two different values?
--
View this message in context:
http://r.789695.n4.nabble.com/Positioning-text-in-top-left-corne
Thanks, mtext with option 'line' does the trick. I could not see that option
in my version of R, but it appeared when I installed it again.
--
View this message in context:
http://r.789695.n4.nabble.com/Positioning-text-in-top-left-corner-of-plot-tp831723p4365088.html
Sent from the R help mailing
56 matches
Mail list logo