mmcdara

7584 Reputation

22 Badges

8 years, 318 days

MaplePrimes Activity


These are questions asked by mmcdara

Hi

Somewhere in the code I've written I've made a mistake: A being a table, I wrote B := eval(A) instead of B := copy(A).
Next A and B were saved in a .m file.

I became aware of my mistake when I read this file in another Maple session.
I modified some entry of B and the corresponding entry of A became modified too.
But this raise the first question: let's say the command B:=eval(A) creates a bon between A and B, why this "bond" is not limited to the current session and by what process is it conserved through  the save/read operations?

To investigate this I wrote this notional piece of code:
 

restart:
A := table([1=x]);
B := eval(A);
FA := "......";   # the name of some file
FB := "......";   # the name of some file
FC := "......";   # the name of some file
save A, B, FC;  # basically what I do in my true code
save A, FA;
save B, FB;

# first attempt
restart;
FC := "......";   # the same name as above
read FC;
B[1] := y;
A[1];
     y


# second attempt
restart;
FA := "......";   # the same name as above
FB := "......";   # the same name as above
read FA;
read FB;
B[1] := y;
A[1];
     x

Why is the "bond" between A and B lost in this second case ?

A-B.mw

Hi, 

Could the Maplesoft staff change the definition of the GammaDistribution in package Statistics?

In the all the papers or courses in the fiels of Probability or Statistics, the shape parameter is the first parameter of this distribution, while the scale (or "rate") parameter is the second.

From versions to versions the Maple definition of this distribution switches these parameters.
It's really a pain in the ass when you want to implement algorithms that use this distribution*

Thanks for your understanding


* for specialists, the Clayton copula uses as an ingredient a sample from Gamma(1/theta, 1) where theta is an adhoc parameter.
In Maple you must code s:=Sample(GammaDistribution(1, 1/theta)).

OK, you could reply me that once I know the trick it is the simplest thing at world to do the switch myself: nevertheless it's really boring, to say the least

Help page says "minus~" is an element-wise operators in Maple
Why this command doesn't return [{1}, {3}] but generates an error ?
[{1, 2}, {2, 3}] minus~ {2};
Error, dimension bounds must be the same for all container objects in an elementwise operation

OK, you can answer I could use  map(u -> u minus {2}, [{1, 2}, {2, 3}]), but it wouldn't explain the reason of the (my?) error.

Thanks in advance

 

 

 

Hi all, 

Still a new visualisation problem ...
I have two random variables X and Y linked together with a dependency structure named "Gumbel copula" (just a technical stuff, if you prefer replace the bold text by "two correlated gaussian RVs X and Y").

I would like to represent on a same figure:

  • the set {(x[n], y[n]), n=1..N} of a sample of size N drawn from the joint distribution of X and Y
    (a ScatterPlot does this very well, even if I use a plot(..., style =point) in the attached file
     
  • the empirical marginal distribution of X (Histogram), put below the line "y = min({y[n], n=1..N} )" and rotated by 180 degrees
     
  • the empirical marginal distribution of Y (Histogram), put left the line "x = min({x[n], n=1..N} )" and rotated counterclockwise by 90 degrees
     

The attached file gives you two examples.

Ideally, if it's not too much to ask, I would like to have the main axes placed in more adequate locations.
For instance, the option "axes=boxed" reject the axes on the left and bottom boundary of the box which contains the 3 plots (not very astute) ; on the other side the default locations of the axes seem better but one of them "cuts" a histogram ... not very smart.
In fact the position of the axes in the "scatter plot" part is good enough for me and I would like to "add" the two histograms without changing these axes.

Is there a solution to do that (I think I read here a rather close problem where a "zom" of a plot was put within this same plot?) ?
TIA


GumbelCopula.mw

Hi all you out there.

I have an UNSORTED sequence  L of floats with elements in the range [a, b > a].
Let c some number such that c < b.
I want to find the smallest k such that L[k] > c.

This problem is related to the search of the "First Hitting Point" (or "First Passage Time") of a random process.
The attached file provides a notional example.
It contains a procedure named FirstHittingPassage which doesn't satisfies me for it is based on an unsmart  "confusion" between an Array and a list.

Would you have a smarter way to proceed ?

Thanks in advance

FirstHittingTime.mw

 

First 41 42 43 44 45 46 47 Page 43 of 47