Description Usage Arguments Value References Examples
fitstdnts
fit parameters (α, θ, β) of the standard NTS distribution.
This function using the curvefit method between the empirical cdf and the standard NTS cdf.
1 2 3 4 5 |
rawdat |
Raw data to fit the parameters. |
initialparam |
A vector of initial standard 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 standard 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library("temStaR")
library("quantmod")
getSymbols("^GSPC", src="yahoo", from = "2010-1-1", to = "2020-12-31")
pr <- as.numeric(GSPC$GSPC.Adjusted)
ret <- diff(log(pr))
stdret <- (ret-mean(ret))/sd(ret)
stdntsparam <- fitstdnts(stdret)
Femp = ecdf(stdret)
x = seq(from=min(stdret), to = max(stdret), length.out = 100)
cemp = Femp(x)
ncdf = pnts(x, c(stdntsparam))
plot(x,ncdf,type = 'l', col = "red")
lines(x,cemp, type = 'l', col = "blue")
a = density(stdret)
p = dnts(x,stdntsparam)
plot(x,p,type = 'l', col = "red", ylim = c(0, max(a$y, p)))
lines(a,type = 'l', col = "blue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.