×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Mittag Leffler function estimation

Mittag Leffler function estimation

Mittag Leffler function estimation

(OP)
Hi all

I have to analyze the waiting time distribution between trades using the Mittag Leffler function.
I simply need to fit 2 parameters of the Mittag Leffler function (see end of 2nd page in this paper:http://econwpa.wustl.edu:80/eps/fin/papers/0411/0411014.pdf
) using the nonlinear fit function (nlfit) embedded in Matlab. I wrote a code that seems
to be reasonable to a roocky like me, but I realised that the MittagLeffler function I estimate converges only in a few cases. In other words I would
like to know if it is possible to write a more consistent code so to obtain
reasonable estimations in almost all the cases.
What I have to do is quite simple: using the function "empirical cdf" (ecdf)
I plot the empirical data (waiting time betwwen trades) in a loglog graph.
Then I try to fit the data to the Mittag Leffler function (and 2 other functions,
but I have more problems with the ML).
I would really appreciate your help expecially because it is summer and I
am sure you have many other funnier things to do!
I hope to hear from you soon since it it very urgent!
I can meet in a chat or I can give you my phone number if you want.

Federico

This is the code I wrote for the Mittag Leffler:

function y = mitlef (parametri, tau) %mittag
tau0 = parametri(1);
beta = parametri(2);

if beta < 0
    printf('beta!!!!\n');
end

Sum = 0;
N = 100;
for n = 0:N
   yn = (-1)^n * ((tau ./ tau0).^(beta*n)) ./ gamma(1 + beta*n);
   Sum = Sum + yn;
end

y = Sum;

%loglog(tau,y); (I wanted to see how the function diverges)


To plot the empirical cdf of the data I need I wrote:

[f, riba_x] = ecdf(emp_data);
riba_y = 1 - f;
hf = figure(1);
loglog(riba_x, riba_y, 'ob')
title('GM') %
set(hf, 'NumberTitle', 'off')
set(hf, 'Name', 'window')
hold on


Then, to fit the ML to the data I wrote this code:

% mittag leffler %
p0 = [4 1]'; %initial parameter values
p = nlinfit (riba_x, riba_y, @mitlef, p0) %non linear fit
fit_y = mitlef(p, riba_x);
plot(riba_x, fit_y, '- .r')

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources