I have a sample, log-returns of a finance time series. The sample size is n=252
. I'd like to estimate a distribution in order to modeling dependence with a copula.
The binned histogram of frequencies, cumulative frequency counts, and qq-plot are below:
I have applied the normality hypothesis test (Anderson-Darling test) and the null hypothesis was rejected at level 0.05 (p-value is 0.003905). I have applied the Kolmogorov-Smirnov test and the null hypothesis can't rejected at level 0.05 (p-value is 0.21769). But the null hypothesis should be rejected based on the Shapiro-Wilk test (p-value is 0.211e-4), the Chen-Shapiro test (5% critical value is 0.00356). Original data is here CFC.csv
mydata = read.csv("CFC.csv") # read csv file
log_returns <- diff(log(mydata$Close), lag=1)
n <- length(log_returns)
mydata$log_ret = with(mydata, c(NA, diff(log(mydata$Close))))
#range(log_returns)
par(mfrow=c(1,3))
hist(log_returns, freq = TRUE, label=TRUE, breaks = 14, xlim=c(-0.08,0.08))
curve(dnorm(x, mean=mean(log_returns),
sd=sd(log_returns)), add=TRUE, col="darkblue", lwd=2)
Fn = ecdf(log_returns)
plot(Fn,
main="CDF of log_returns",
xlab="log_returns",
ylab="Cumulative Frequency")
qqnorm(log_returns)
qqline(log_returns)
shapiro.test(log_returns)
# Shapiro-Wilk normality test
# data: log_returns
# W = 0.97509, p-value = 0.000211
# required
library(nortest)
ad.test(log_returns)
# Anderson-Darling normality test
# data: log_returns
# A = 1.1991, p-value = 0.003905
Problem. Data is not normal. Add I don't know how to specify a distribution to modeling dependence with a copula.
My attempt is: I have applied the Johnson's transformation to normalize the data.
# require
library(Johnson)
#Applying Johnson transformation
log_returns_JT<-RE.Johnson(log_returns)
#$p
#[1] 0.2304269
#$f.gamma
#[1] 0.1002716
#$f.lambda
#[1] 0.03428872
#$f.epsilon
#[1] 0.00456466
#$f.eta
#[1] 2.109682
hist(log_returns_JT$transformed, freq = TRUE, label=TRUE)
curve(dnorm(x, mean=mean(log_returns),
sd=sd(log_returns)), add=TRUE, col="darkblue", lwd=2)
curve(dnorm(x, mean=mean(log_returns_JT$transformed),
sd=sd(log_returns_JT$transformed)), add=TRUE, col="red", lwd=2)
Fn = ecdf(log_returns_JT$transformed)
plot(Fn,
main="CDF of log_returns_JT",
xlab="log_returns_JT",
ylab="Cumulative Frequency")
qqnorm(log_returns_JT$transformed)
qqline(log_returns_JT$transformed)
shapiro.test(log_returns_JT$transformed)
#Shapiro-Wilk normality test
#data: log_returns_JT$transformed
#W = 0.99465, p-value = 0.5217
ad.test(log_returns_JT$transformed)
#Anderson-Darling normality test
#data: log_returns_JT$transformed
#A = 0.48099, p-value = 0.2304
(adt.p<-RE.ADT(log_returns_JT$transformed)$p)
# [1] 0.2304269
Here are the binned histogram of frequencies, cumulative frequency counts, and qq-plot after the Johnson's transformation:
I have applied the normality hypothesis test (Anderson-Darling test) and the null hypothesis can't reject at level 0.05 (p-value is 0.2304269).
Edit. I'm reading the papers recommended by @user25459 but, unfortunately, I don't find the answer for my question yet.
Questions. Is it possible to use a normal copula to modeling dependence and set the marginal distribution as the normal distribution?
After the modeling I'm going to apply the inverse transformation.