Displaying 16 results from an estimated 16 matches for "adjclose".
2011 Mar 13
1
problem with looping formula through table
...pe to scale this up say for 30+ stocks (DAX-30, FTSE-100 etc.) to eventually have a matrix of coefficients and p-values for each individual stock.
First, let's get share prices:
library(tseries)
sie <- get.hist.quote(instrument="SIE.DE", start="2010-01-01", quote="AdjClose")
vow <- get.hist.quote(instrument="VOW.DE", start="2010-01-01", quote="AdjClose")
lin <- get.hist.quote(instrument="LIN.DE", start="2010-01-01", quote="AdjClose")
dax <- get.hist.quote(instrument="^GDAXI", start=&q...
2011 May 15
4
DCC-GARCH model
...f two indices - S&P500 and DJ. And the aim is to estimate
coefficients of the DCC-GARCH model for them. This is how I do it:
library(tseries)
p1 = get.hist.quote(instrument = "^gspc",start = "2005-01-07",end =
"2009-09-04",compression = "w", quote="AdjClose")
p2 = get.hist.quote(instrument = "^dji",start = "2005-01-07",end =
"2009-09-04",compression = "w", quote="AdjClose")
p = cbind(p1,p2)
y = diff(log(p))*100
y[,1] = y[,1]-mean(y[,1])
y[,2] = y[,2]-mean(y[,2])
T = length(y[,1])
library(ccgarch)...
2008 Mar 15
1
feeding merge.zoo a vector containing the names of zoo objects?
...t I cannot for the life of me
figure it out. Thanks in advance for any enlightenment 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 li...
2011 Jan 29
1
Basic Help with Zoo objects and trading days
...me series downloaded using get.hist.quote() from the tseries
package, ie......
startDate= as.Date("2000-01-01")
endDate= as.Date("2011-01-29")
frequency= 'd'
s= get.hist.quote('IWF', start= startDate, end= endDate,
compression= 'd', quote= "AdjClose")
tail(s,30)
AdjClose
2010-12-16 56.85
2010-12-17 56.95
2010-12-20 57.00
2010-12-21 57.32
2010-12-22 57.37
2010-12-23 57.30
2010-12-27 57.30
2010-12-28 57.29
2010-12-29 57.43
2010-12-30 57.34
2010-12-31 57.26
2011-01-03 57.80
2011-01-04 57.55...
2011 May 12
2
DCC-GARCH model and AR(1)-GARCH(1,1) regression model
...indices - S&P500 and DJ. And my first aim is to
estimate coefficients of the DCC-GARCH model for them. This is how I do it:
library(tseries)
p1 = get.hist.quote(instrument = "^gspc",start = "2005-01-07",end =
"2009-09-04",compression = "w", quote="AdjClose")
p2 = get.hist.quote(instrument = "^dji",start = "2005-01-07",end =
"2009-09-04",compression = "w", quote="AdjClose")
p = cbind(p1,p2)
y = diff(log(p))*100
y[,1] = y[,1]-mean(y[,1])
y[,2] = y[,2]-mean(y[,2])
T = length(y[,1])
library(ccgarch)...
2017 Jul 30
4
Kalman filter for a time series
...to fix the code so that it
runs?
library(KFAS)
library(tseries)
library(timeSeries)
library(zoo)
library(quantmod)
getDailyPrices = function( tickerSym, startDate, endDate )
{
prices = get.hist.quote( instrument = tickerSym, start = startDate,
end = endDate,
quote="AdjClose", provider="yahoo",
compression="d", quiet=T)
prices.ts = ts(prices)
return( prices.ts )
}
kalmanFilter = function( x )
{
t = x
if (class(t) != "ts") {
t = ts(t)
}
ssModel = structSSM( y = t, distribution="Gaussian&qu...
2010 Jun 09
3
Extracting Elements By Date
Dear R Gurus,
Thanks for any help in advance!
Date.frame: Returns.names
X id ticker date_ adjClose totret RankStk
258060 258060 13645T10 CP 2001-06-29 18.125 1877.758
My data frame is in the above format. I would like to filter by period, per
id (every 125 days) each consisting of 250 days, I.e. 1-250, 126-375, etc.
One important thing to note is that not all ID's have the sam...
2010 Jun 08
1
Filtering out a data.frame
Sample Data.Frame format
Name is Returns.nodup
X id ticker date_ adjClose totret RankStk
427225 427225 00174410 AHS 2001-11-13 21.66 100 1235
"id" uniquely defines a row
What I am trying to do is filter out id's that have less than 1500 data
points (by date)
First, I used
total<-by(Returns.nodup, Returns.nodup$id,nrow)
which subsetted...
2010 Dec 02
1
Downloading quote data from yahoo finance
...x, main = "International Business Machines Corp")
spc <- get.hist.quote(instrument = "^gspc", start = "1998-01-01",
quote = "Close")
ibm <- get.hist.quote(instrument = "ibm", start = "1998-01-01",
quote = "AdjClose")
x <- merge(spc, ibm)
plot(x, main = "IBM vs S&P 500")
x <- get.hist.quote(instrument = "EUR/USD", provider = "oanda",
start = Sys.Date() - 500)
plot(x, main = "EUR/USD")
}
Error message:
Warning message:
In o...
2011 May 10
0
DCC-GARCH model and AR(1)-GARCH(1, 1) regression model - help needed..
...indices - S&P500 and DJ. And my first aim is to
estimate coefficients of the DCC-GARCH model for them. This is how I do it:
library(tseries)
p1 = get.hist.quote(instrument = "^gspc",start = "2005-01-07",end =
"2009-09-04",compression = "w", quote="AdjClose")
p2 = get.hist.quote(instrument = "^dji",start = "2005-01-07",end =
"2009-09-04",compression = "w", quote="AdjClose")
p = cbind(p1,p2)
y = diff(log(p))*100
y[,1] = y[,1]-mean(y[,1])
y[,2] = y[,2]-mean(y[,2])
T = length(y[,1])
library(ccgarch)...
2017 Jul 30
0
Kalman filter for a time series
...)
> library(tseries)
> library(timeSeries)
> library(zoo)
> library(quantmod)
>
> getDailyPrices = function( tickerSym, startDate, endDate )
> {
> prices = get.hist.quote( instrument = tickerSym, start = startDate,
> end = endDate,
> quote="AdjClose", provider="yahoo",
> compression="d", quiet=T)
>
> prices.ts = ts(prices)
> return( prices.ts )
> }
>
> kalmanFilter = function( x )
> {
> t = x
> if (class(t) != "ts") {
> t = ts(t)
> }
> s...
2012 Mar 10
1
Generating abnormal returns in R
...S.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 for that stock
pricedata = na.approx...
2010 Jun 04
5
R Newbie, please help!
...re about 150 different IDs & the dataset spans 3 million rows. The main
columns of concern are ID, date, and totret. What I need to do is to derive
daily returns for each ID from totret, which is simply totret at time t+1
divided by totret at time t.
X id ticker date_ adjClose totret RankStk
427225 427225 00174410 AHS 2001-11-13 21.66 100.00000 1235
441910 441910 00174410 AHS 2001-11-14 21.60 99.72300 1235
458458 458458 00174410 AHS 2001-11-15 21.65 99.95380 1235
284003 284003 00174410 AHS 2001-11-16 21.59 99.67680 1235...
2011 Dec 17
0
time-varying parameters kalman filter estimation problem using FKF package
...y(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)
BP.ret <- lag(log(BP), k = -1) - log(BP)
# collect data
data <- merge(BP.ret,FTSE100.ret, all = FALSE)
index <- index(data)
# cre...
2017 Jul 30
0
Kalman filter for a time series
...gt; library(tseries)
> library(timeSeries)
> library(zoo)
> library(quantmod)
>
> getDailyPrices = function( tickerSym, startDate, endDate )
> {
> prices = get.hist.quote( instrument = tickerSym, start = startDate,
> end = endDate,
> quote="AdjClose", provider="yahoo",
> compression="d", quiet=T)
>
> prices.ts = ts(prices)
> return( prices.ts )
> }
>
> kalmanFilter = function( x )
> {
> t = x
> if (class(t) != "ts") {
> t = ts(t)
>...
2010 Mar 17
1
Reg GARCH+ARIMA
Hi,
Although my doubt is pretty,as i m not from stats background i am not sure
how to proceed on this.
Currently i am doing a forecasting.I used ARIMA to forecast and time series
was volatile i used garchFit for residuals.
How to use the output of Garch to correct the forecasted values from ARIMA.
Here is my code:
###delta is the data
fit<-arima(delta,order=c(2,,0,1))
fit.res <-