fitnts | R Documentation |
fitnts
fit parameters (\alpha, \theta, \beta, \gamma, \mu)
of the NTS distribution.
This function using the curvefit method between the empirical cdf and the NTS cdf.
fitnts(rawdat)
fitnts(rawdat), ksdensityflag = 1
fitnts(rawdat, initialparam = c(alpha, theta, beta, gamma, mu))
fitnts(rawdat, initialparam = c(alpha, theta, beta, gamma, mu)), ksdensityflag = 1
fitnts(rawdat, initialparam = c(alpha, theta, beta, gamma, mu)), maxeval = 100, ksdensityflag = 1
rawdat |
Raw data to fit the parameters. |
initialparam |
A vector of initial NTS parameters.
This function uses the |
maxeval |
Maximum evaluation number for |
ksdensityflag |
This function fit the parameters using the curvefit method between the empirical cdf and the NTS cdf.
If |
Estimated parameters
Kim, Y. S. (2020) Portfolio Optimization on the Dispersion Risk and the Asymmetric Tail Risk https://arxiv.org/pdf/2007.13972.pdf
library(evmix)
library(spatstat)
library("temStaR")
library("quantmod")
getSymbols("^GSPC", src="yahoo", from = "2013-1-1", to = "2023-12-31")
pr <- as.numeric(GSPC$GSPC.Adjusted)
ret <- diff(log(pr))
ntsparam <- fitnts(ret)
Femp = ecdf(ret)
x = seq(from=min(ret), to = max(ret), length.out = 100)
cemp = Femp(x)
ncdf = pnts(x, c(ntsparam))
plot(x,ncdf,type = 'l', col = "red")
points(x,cemp, type = 'l', col = "blue")
a = density(ret)
p = dnts(x,ntsparam)
plot(x,p,type = 'l', col = "red")
lines(a,type = 'l', col = "blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.