Displaying 14 results from an estimated 14 matches for "retclass".
Did you mean:
regclass
2008 Mar 15
1
feeding merge.zoo a vector containing the names of zoo objects?
...enment offered.
library(zoo)
CADstocknames <- c("xbb.to","xsb.to","xiu.to")
for(i in 1:length(CADstocknames)){
assign(CADstocknames[i], get.hist.quote(CADstocknames[i],quote =
"AdjClose"))
}
mergedCAD <- merge.zoo(xbb.to,xsb.to,xiu.to, all = TRUE, retclass
="data.frame")
tail(mergedCAD)
--
View this message in context: http://www.nabble.com/feeding-merge.zoo-a-vector-containing-the-names-of-zoo-objects--tp16067806p16067806.html
Sent from the R help mailing list archive at Nabble.com.
2010 Oct 07
1
R - Confidence Intervals
...e.g. IBM:
library('tseries')
data<-get.hist.quote(instrument="IBM", start="2000-01-01",
end="2010-10-04", quote=c("O","H","L","C","A","V"),
compression='d',provider="yahoo", retclass="zoo")
names(IBM)
I have defined the parameters as follows:
Pt=IBM$Adj.Close
r=diff(log(Pt))
l=length(Pt)
mu=mean(r)
t=2:l
Given the formula for confidence intervals E(logPt)=logP0+μ*t
+1.96*sqrt(t)*s^2, I tried to define a formula in R:
logP1=numeric()
> logP1[1]=log(Pt[1])
&...
2006 Nov 23
1
Problem with as.ts(zoo-object)
...' num [1:3] 8895 8925 8955
> is.regular(test)
[1] TRUE
> as.ts(test)
Error in z[match0(index(a), indexes), ] <- a[match0(indexes, index(a))]
:
number of items to replace is not a multiple of replacement
length
> traceback()
7: FUN(X[[1]], ...)
6: lapply(args, f, ret.zoo = retclass %in% c("list", "data.frame"))
5: merge.zoo(zoo(coredata(x), tt), zoo(, tt2))
4: merge(zoo(coredata(x), tt), zoo(, tt2))
3: as.ts.zooreg(x)
2: as.ts.zoo(test)
1: as.ts(test)
I will use coredata() to resolve the situation in the larger context.
Anyway, does anybody know to remove...
2011 Dec 17
0
time-varying parameters kalman filter estimation problem using FKF package
...+ betat * rmt + et
# alphat = alphat_1 + n1t
# betat = betat_1 + n2t
# where et ~ N(0,H)
# (n1t,n2t) ~ N(0,Q)
#load required packages
library(tseries)
library(FKF)
# load data
FTSE100 <- get.hist.quote(instrument = "^FTSE", start = "2007-01-01", quote
= "Close", retclass = "zoo", quiet = TRUE)
BP <- get.hist.quote(instrument = "BP", start = "2007-01-01", quote =
"AdjClose", retclass = "zoo", quiet = TRUE)
# calulate continuously compounded daily returns
FTSE100.ret <- lag(log(FTSE100), k = -1) - log(FTSE100...
2009 Mar 15
1
cbind(NULL,zoo.object)?
...3 12514 12515 12516
2.65917577 1.17190442 0.83836389 -0.29397904 -0.13243782 0.26200299
12521 12524 12528 12529
2.16601368 0.37524502 0.01084510 1.56555812
Warning message:
In merge.zoo(..., all = all, fill = fill, suffixes = suffixes, retclass = "zoo") :
Index vectors are of different classes: integer Date
Is there an easy workaround; or am I deeply confused; is there a way
out? :-)
--
Ajay Shah http://www.mayin.org/ajayshah
ajayshah at mayin.org http://a...
2010 Dec 07
3
help on timeseries
...1
2005-11-03 26.44 25.55180 1
2005-11-04 26.66 25.55685 1
-code
library(tseries)
library(timeSeries)
msft <- as.timeSeries(get.hist.quote(instrument="MSFT", start="1986-03-31",
end="2008-09-10", quote=c("C"), provider="yahoo", retclass="zoo"))
msft <- cbind(msft,as.timeSeries(rollapply(as.zoo(msft
),width=200,mean,align="right")))
msft <- cbind(msft,NA)
msft[,3] <- (ifelse(msft[,1]>msft[,2],1,-1))
print(msft)
--
View this message in context: http://r.789695.n4.nabble.com/help-on-timeseries-...
2009 Apr 19
1
dynlm question: How to predefine formula for call to dynlm(formula) call
...990(4)
<snip>
Works OK without a Lag term
R> dynlm(gas ~ L(gas,1))
Time series regression with "ts" data:
Start = 1959(2), End = 1990(4)
<snip>
Works OK with a Lag with this type of call
R> form <- gas~L(gas,1)
R> dynlm(form)
Error in merge.zoo(gas, L(gas, 1), retclass = "list", all = FALSE) :
could not find function "L"
Does not work using a predefined formula with a Lag (This type of call
works using dyn$lm from library(dyn))
How do I make the call (or how do I setup form) so that this works in dynlm?
Thanks for any help,
Ron
To...
2012 Mar 10
1
Generating abnormal returns in R
...uot; , "HEIA.AS"
, "ACS.MC" , "LG.PA" , "STAN.L" , "ALU.PA" , "FRE.MU" , "SW.PA" , "WOS.L" ,
"AKZA.AS" , "HEN.MU")
for( series in tickers ){
print(series)
close <-
get.hist.quote(instrument=series,retclass="zoo",quote="AdjClose",compression="d",
start="2000-1-1", end="2011-12-31",quiet=TRUE)
if(series==tickers[1]){ pricedata = close }else{ pricedata = merge(
pricedata , close ) }
}
colnames(pricedata) = tickers
# Avoid a missing because of trade halt...
2007 May 03
0
Ryacas now on CRAN
...re row-wise
>
> List(List(1,2),List(x,6))
expression(list(list(1, 2), list(x, 6)))
> PrettyForm("%")
/ \
| ( 1 ) ( 2 ) |
| |
| ( x ) ( 6 ) |
\ /
>
> # output TeX
>
> k <- Sym('k')
> yacas(TeXForm((x+1)^2 + k^3), retclass = 'unquote')
$\left( x + 1\right) ^{2} + k ^{3}$
>
> detach()
>
yacas was developed by Ayal Pinkus and other contributors.
Ryacas was developed by Rob Goedman, Gabor Grothendieck,
S?ren H?jsgaard and Ayal Pinkus. Contact Rob for Mac
issues and Gabor for all other issues.
___...
2007 May 03
0
Ryacas now on CRAN
...re row-wise
>
> List(List(1,2),List(x,6))
expression(list(list(1, 2), list(x, 6)))
> PrettyForm("%")
/ \
| ( 1 ) ( 2 ) |
| |
| ( x ) ( 6 ) |
\ /
>
> # output TeX
>
> k <- Sym('k')
> yacas(TeXForm((x+1)^2 + k^3), retclass = 'unquote')
$\left( x + 1\right) ^{2} + k ^{3}$
>
> detach()
>
yacas was developed by Ayal Pinkus and other contributors.
Ryacas was developed by Rob Goedman, Gabor Grothendieck,
S?ren H?jsgaard and Ayal Pinkus. Contact Rob for Mac
issues and Gabor for all other issues.
___...
2010 Apr 20
1
converting a zoo or an xts to a data frame
Dear R People:
I have the following code that I use to convert a monthly zoo object
to a data.frame, and it works perfectly:
library(tseries)
z <- get.hist.quote(instrument=inst1, start=start1,end=end1,
quote=quot1,comp = "m")
y <- as.ts(aggregate(z, as.yearmon, tail, 1))
y.df <- data.frame(y=y,time=time(y))
y.df$x <- ts(y.df[,1])
tsp(y.df$x) <-
2007 Aug 16
1
time series with quality codes
list(...),
I am working with environmental time series (eg rainfall, stream flow)
that have attached quality codes for each data point. The quality
codes have just a few factor levels, like "good", "suspect", "poor",
"imputed". I use the quality codes in plots and summaries. They are
carried through when a time series is aggregated to a longer
time-step,
2012 Jul 31
2
How can I declare an empty zoo object?
Hi,
I let xzoo be an empty object:
> xzoo<-{}
and I have an existing zoo object x1zoo_f. I would like to combine
the two to make a new zoo object, and continue doing so in a loop,
which is not shown here. However, when I type
> xzoo<-cbind(xzoo, x1zoo_f)
An error message emerges
Error in zoo(structure(x, dim = dim(x)), index(x), ...) :
“x” : attempt to define
2005 Sep 29
2
priceIts
Dear All,
There is an example for the priceIts function (the its package) which
does not work for me as expected.
> ?priceIts
> x1 <- priceIts(instrument = c("^ftse"), start = "1998-01-01",
+ quote = "Close")
Error in validObject(.Object) : invalid class "its" object: Missing
values in dates
> x2 <-