Description Usage Arguments Details Value Examples
This function computes the log-likelihood for a Gaussian random walk model
1 | normlklhd(x)
|
x |
is a n x 1 numeric data vector |
This function computes the log-likelihood for the Gaussian random walk model. It is used as a benchmark in Fry (2014)
y a 1 x 1 scalar which is the log-likelihood
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
#Create data set with log-returns
library(PerformanceAnalytics)
path.bit=system.file("extdata", "coindesk-bpi-USD-close.csv", package = "bubble")
#load data on bitcoin downloaded from coindesk: http://www.coindesk.com/price/
dat <- read.table(path.bit, dec = ".", sep =",", header = TRUE)
dat2 <- subset(dat, as.numeric(Date) > 898 & as.numeric(Date) < 1233)
row.names(dat2) <- levels(dat2$Date)[dat2$Date]
dat3 <- dat2[, 'Close', drop=FALSE]
#compute log-returns
bitret <- CalculateReturns(dat3, method="log")
bitret = bitret[-1,]
plot(bitret)
plot(cumsum(bitret))
#Compute the log-likelihood of the Gaussian random walk model as a benchmark
normlklhd(bitret)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.