Please Help me about matlab code

1 view (last 30 days)
sibel çelik
sibel çelik on 20 Jun 2018
Edited: Stephen23 on 20 Jun 2018
Is there anyone WHO can look at following matlab code. This is estimation of CoVaR which is a measure of systemic risk. The code gives following error: "Not enough input arguments.
Error in quantilereg (line 17) ry=length(y); %number of rows of dependant variable (ry=rx)"
I am new at matlab. Code and the data have been attached. Please help me

Answers (1)

Stephen23
Stephen23 on 20 Jun 2018
Edited: Stephen23 on 20 Jun 2018
The problem is how you are calling the function. quantilereg is a function that requires three input arguments:
quantilereg(y,x,theta)
But you are not calling it with any input arguments (possibly by clicking the big green RUN button, which should be IGNORED). Call the function with three input arguments and you will not have this problem. Note that quantilereg does not appear to read any file data, so your file is totally irrelevant to this function.
How to call functions is explained in the introductory tutorials:
How to import files is explained in the documentation:
  2 Comments
Stephen23
Stephen23 on 20 Jun 2018
sibel çelik's "Answer" moved here:
Thank you very much for your fast response. This is not my code. This is written by Sylvain Benoit for his academic research. I am only running this code. I look at the links which you sent me. However I do not know how I can call the quantilereg function. Could you please help me about this?
Stephen23
Stephen23 on 20 Jun 2018
Edited: Stephen23 on 20 Jun 2018
To call the function you will need something like this:
x = ...
y = ...
theta = ...
quantilereg(y,x,theta)
Where each ellipsis ... represents your definition of that variable, following the specifications given in the function help, e.g.:
x = [1;2;3];
y = [4;5;6];
theta = 0.5;
"However I do not know how I can call the quantilereg function"
The introductory tutorials show how to call functions. I presume that you have now worked through the tutorials to learn basic MATLAB usage, such as how to call functions.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!