Now, we move on to one of the applications of copula: regression.
Define predictor data x and response y.
load stockreturns
x = stocks(:,2);
y = stocks(:,1);
Use that data to perform a regression.
[yhat,CI] = copreg(x,y,'xpred',x,'ypred',y);
% ===== OUTPUT ======
Case: 1-predictor
Method: Bivariate copula
Regression Progress: 100.00%
Data length for fitting = 100
Data length for predicting = 100
Evaluation Results:
RMSE = 0.72001
MAPE = 5.2814
wMAPE = 0.70893
Let’s look at an example for other data.
load polydata
x = x(:);
y = y(:);
[yhat,CI] = copreg(x,y); % Only Perform the regression without predict data
% ===== OUTPUT ======
Case: 1-predictor
Method: Bivariate copula
Regression Progress: 100.00%
Data length for fitting = 43
Download: this example is available on demo3.m
. Visit Github
Visit my personal blog
@ 2021-2023 Mohamad Khoirun Najib