... share your algorithms as a web service

Algorithm: Draw Covariance Bounds for Two Random Variables

Draws a family of covariance bounds using partially known correlations, condition has to be entered as symmetric with |r|<=rmax
Also see
Tags: visualization unknown correlation
Depends On: "Ellipsoidal toolbox essentials" by florian.pfaff (latest version)
Usage: Algorithm is public.
Viewed 2525 times, called 37 times
Empty star Empty star Empty star Empty star Empty star
0 votes
Florian Pfaff
02/16/2013 2:31 p.m. (version #1)

Run Algorithm

: Bound for correlation coefficient
: Covariance of random variable x
: Covariance of random variable y
: Allow cached result?

Please Wait

Computation is running...


showing plot # of

Result Value(s)


Resource Usage

Execution of the algorithm took seconds.
Peak memory usage for running the algorithm was kilobytes (total usage: kilobytes).

Run ID / Link

ID of this run:

Result from Cache

Result has been delivered from cache and computed on (UTC).

Matlab log




Using this algorithm in your local MATLAB environment is easy: Click here for instructions!

Usage Instructions for CloudRunner Client

  1. Download the CloudRunner Client by clicking here and place the downloaded file in your MATLAB working directory.

  2. Inside MATLAB, initialize the CloudRunner Client by calling CloudRunner:
    >> CloudRunner

    A login dialog will prompt for your CloudRunner mail address and password. For a start, you can leave the dialog empty and just click "Connect".

    Alternatively, you can provide the login credentials (or empty strings to skip login) as a parameter and hence skip the login dialog. This is useful when using CloudRunner in non-interactive scripts.
    >> CloudRunner('', 'password')

  3. Select this algorithm by its URL. Selecting an algorithm creates the lambda function that proxies calls to the algorithm to the server for execution:
    >> CloudRunnerSelect('')

    For the sake of convenience, you can also use the algorithm ID instead of its URL for public algorithms.

  4. Call functions from the algorithm like any regular local function.

Note: You can find further information on the help page.

Source Code


 1 function drawApproximations(rmax,Cxx,Cyy)
 2 % @author Florian Pfaff
 3 % @date 2013
 4     rmin=-rmax;
 5     if (abs(rmin)>1 || abs(rmax)>1)
 6         error('Please set valid correlation-coefficient');
 7     end
 8     figure(1),clf,axis([-1.7*sqrt(Cxx),1.7*sqrt(Cxx),-1.7*sqrt(Cyy),1.7*sqrt(Cyy)]),hold on
 9     if rmin==rmax
10         plot(ellipsoid([0;0],[Cxx,rmin*sqrt(Cxx*Cyy);rmin*sqrt(Cxx*Cyy),Cyy]));
11         return;
12     end
13     plot(ellipsoid([0;0],[Cxx,rmin*sqrt(Cxx*Cyy);rmin*sqrt(Cxx*Cyy),Cyy]),'g');
14     for i=1:40
15         %drawnow;
16         rCurr=rmin+i*(rmax-rmin)/40;
17         rPrev=rmin+(i-1)*(rmax-rmin)/40;
18         plot(ellipsoid([0;0],[Cxx,rCurr*sqrt(Cxx*Cyy);rCurr*sqrt(Cxx*Cyy),Cyy]),'g');
19         plot(ellipsoid([0;0],[Cxx,rPrev*sqrt(Cxx*Cyy);rPrev*sqrt(Cxx*Cyy),Cyy]),'r');
20     end
21     %drawnow
22     plot(ellipsoid([0;0],[Cxx,rCurr*sqrt(Cxx*Cyy);rCurr*sqrt(Cxx*Cyy),Cyy]),'r');
23     eta=@(kappa)(1-sqrt(rmax^2+kappa^2*(1-rmax^2)^2))/(1-rmax^2);
25     kappaValues=-0.49:0.05:0.49;
26     for kappa=kappaValues
27         Ctotal=[(1/(eta(kappa)-kappa))*Cxx,0;0,(1/(eta(kappa)+kappa))*Cyy];
28         plot(ellipsoid([0;0],Ctotal),'b')
29         drawnow
30     end
32 end
Download algorithm (1 file) as ZIP


Please login to post a comment.