Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added FPCAcomponents/FPCA_Figure2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions FPCAcomponents/FPCAcomponents
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
% clear variables and close windows
clear all;
close all;
clc;

%%% Start READ REAL DATA
load Results.mat % the workspace results are generated by the code FPCAreal_data.m
load('xData.txt','-ascii');
load('Is.txt','-ascii');
load('tickdatayear.txt','-ascii');

%%% End READ REAL DATA

%%% Start PLOT FIGURE

% define axis
axis_x=linspace(min(mx),max(mx),50); % maturity
axis_y=linspace(min(my),max(my),50); % moneyness
[Xa,Ya] = meshgrid(axis_x,axis_y);

% interpolate data for the functional components
FFun1 = TriScatteredInterp(mx,my,V2b(:,1), 'linear');
FFun2 = TriScatteredInterp(mx,my,V2b(:,2), 'linear');
FFun3 = TriScatteredInterp(mx,my,V2b(:,3), 'linear');
FFun4 = TriScatteredInterp(mx,my,V2b(:,4), 'linear');
FFun5 = TriScatteredInterp(mx,my,V2b(:,5), 'linear');
FFun6 = TriScatteredInterp(mx,my,V2b(:,6), 'linear');
FFun7 = TriScatteredInterp(mx,my,V2b(:,7), 'linear');
FFun8 = TriScatteredInterp(mx,my,V2b(:,8), 'linear');

Za1b=FFun1(Xa,Ya);
Za2b=FFun2(Xa,Ya);
Za3b=FFun3(Xa,Ya);
Za4b=FFun4(Xa,Ya);
Za5b=FFun5(Xa,Ya);
Za6b=FFun6(Xa,Ya);
Za7b=FFun7(Xa,Ya);
Za8b=FFun8(Xa,Ya);

figure(2)
hFig = figure(2);
set(hFig, 'Position', 0.8*[500 500 1000 900])

subplot(3,2,1)
surfl(Xa,Ya,-Za1b);
set(gca,'XTick',[0.50 0.75 1 1.25 1.50])
set(gca,'YTick',[0 0.25 0.50 0.75 1 ])
xh=xlabel('Moneyness')
yh=ylabel('Maturity')
zh=zlabel('$$\hat{\gamma}^{(d)}_{1,T}$$')
set(zh,'Interpreter','latex')
set([xh,yh,zh],'fontsize',10)
set(gca, 'fontsize',10)

subplot(3,2,2)
plot(xData,-loadsb(1,Is),'blue')
xlim([min(xData) max(xData)])
zh=ylabel('$$\hat{\delta}_{1,T}$$')
set(zh,'Interpreter','latex')
set(gca,'XTick',tickdatayear([1,3,5,7,9,11]))
set(gca,'XTickLabel',[2002 2004 2006 2008 2010 2012])
set(gca, 'LooseInset', get(gca, 'TightInset'));
set([xh,yh],'fontsize',10)
set(gca, 'fontsize',10)

subplot(3,2,5)
surfl(Xa,Ya,-Za7b);
set(gca,'XTick',[0.50 0.75 1 1.25 1.50])
set(gca,'YTick',[0 0.25 0.50 0.75 1 ])
xh=xlabel('Moneyness')
yh=ylabel('Maturity')
zh=zlabel('$$\hat{\gamma}^{(d)}_{7,T}$$')
set(zh,'Interpreter','latex')
set([xh,yh,zh],'fontsize',10)
set(gca, 'fontsize',10)

subplot(3,2,6)
plot(xData,-loadsb(7,Is),'blue')
xlim([min(xData) max(xData)])
zh=ylabel('$$\hat{\delta}_{7,T}$$')
set(zh,'Interpreter','latex')
set(gca,'XTick',tickdatayear([1,3,5,7,9,11]))
set(gca,'XTickLabel',[2002 2004 2006 2008 2010 2012])
set(gca, 'LooseInset', get(gca, 'TightInset'));
set([xh,yh],'fontsize',10)
set(gca, 'fontsize',10)

subplot(3,2,3)
surfl(Xa,Ya,-Za3b);
set(gca,'XTick',[0.50 0.75 1 1.25 1.50])
set(gca,'YTick',[0 0.25 0.50 0.75 1 ])
xh=xlabel('Moneyness')
yh=ylabel('Maturity')
zh=zlabel('$$\hat{\gamma}^{(d)}_{3,T}$$')
set(zh,'Interpreter','latex')
set([xh,yh,zh],'fontsize',10)
set(gca, 'fontsize',10)

subplot(3,2,4)
plot(xData,-loadsb(3,Is),'blue')
xlim([min(xData) max(xData)])
zh=ylabel('$$\hat{\delta}_{3,T}$$')
set(zh,'Interpreter','latex')
set(gca,'XTick',tickdatayear([1,3,5,7,9,11]))
set(gca,'XTickLabel',[2002 2004 2006 2008 2010 2012])
set(gca, 'LooseInset', get(gca, 'TightInset'));
set([xh,yh],'fontsize',10)
set(gca, 'fontsize',10)

%%% End PLOT FIGURE
1 change: 1 addition & 0 deletions FPCAcomponents/Is.txt

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions FPCAcomponents/Metainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Name of Quantlet: FPCAcomponents

Published in: 'Functional Principal Component Analysis for Derivatives of High-Dimensional Spatial Curves'

Description: 'It interpolates the estimated functional components at a common grid and plots them, together with the estimates loadings time series.''

Keywords: estimation, FPCA, call prices, derivative, density, state price density, risk neutral density, functional components, time series, loadings

See also: FPCAgpu, FPCAepan, FPCAmultiloc, FPCAsimulate_input, FPCAindividual, FPCAvariance, FPCAexpiration, FPCAcomponents, FPCAloadings

Author: Maria Grith

Submitted: Maria Grith

Input:
- Results.mat : Output of FPCAreal_data.m
- vdaxm.txt : VDAX index time series (same date as the loadings)
- xData.txt : date time series
- Is.txt : index for the time series of loadings
- tickdatayear.txt : tick years

Output: 'It plots the functional components and the corresponding loadings.''
Binary file added FPCAcomponents/Results.mat
Binary file not shown.
1 change: 1 addition & 0 deletions FPCAcomponents/tickdatayear.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.3121800e+05 7.3158300e+05 7.3194800e+05 7.3231500e+05 7.3267900e+05 7.3304400e+05 7.3340900e+05 7.3377500e+05 7.3414200e+05 7.3450600e+05 7.3486700e+05
1 change: 1 addition & 0 deletions FPCAcomponents/vdaxm.txt

Large diffs are not rendered by default.

Loading