Nonparametric Finance

Introduction

This page provides supplementary materials for the book "Nonparametric Finance", to be published.

See the table of contents and the introduction.

Links

See the product page of Wiley.

Reproducing the Results

Install Software

The methods are implemented as R-functions.

source("http://jklm.fi/denpro/denpro.R")
source("http://jklm.fi/regpro/regpro.R")
source("http://jklm.fi/finatool/finatool.R")

Chapter 2. Financial Instruments

Read Daily SP500 Data

file<-"http://jussiklemela.com/statfina/sp500"
y<-read.csv(file=file)[,1]
times0<-matrix(0,length(y),1)
delta<-1/251.63
alku<-1950+2/12
for (i in 1:length(times0)) times0[i]<-alku+(i-1)*delta
plot(times0,y,type="l")
  
m<-length(y)
dendat<-sp500[2:m]/sp500[1:(m-1)]
times<-times0[2:n]
plot(times,dendat,type="l")

Read Daily SP500 and Nasdaq-100 Data

file<-"http://jussiklemela.com/statfina/sp500-ndx100.csv"
price<-read.csv(file=file)

retur<-returns(price)+1
m<-dim(retur)[1]+1
wealth<-matrix(1,m,2)
for (i in 2:m){
    wealth[i,1]<-wealth[i-1,1]*(retur[i-1,1])
    wealth[i,2]<-wealth[i-1,2]*(retur[i-1,2])
}

times0<-matrix(0,dim(price)[1],1)
delta<-1/251.63
alku<-1985+9/12
for (i in 1:length(times0)) times0[i]<-alku+(i-1)*delta
times<-times0[2:length(times0)]

matplot(times0,wealth,xlab="",ylab="",type="l",lty=1)

plot(retur,xlab="",ylab="")
mtext("S&P 500",side=1,line=2.4)
mtext("Nasdaq-100",side=2,line=2.4)

 

Chapter 7. Volatility Prediction

Volatility prediction is covered in home page of "Volatility prediction using kernel regression".

July 2017