370 Reputation

10 Badges

6 years, 58 days

MaplePrimes Activity

These are replies submitted by sand15


Thank you (I'm replying from my office).

@Carl Love 

I discovered MathML in the context of Maple a few months ago and found it very useful although a bit confusing at first
Avoiding parse and "..." indeed makes things more readable.



Thank you acer, 


(from my professional account)

Thank's for having this modification.
It was so natural that I blame myself for not having thought of it myself.


I was aware of the existence of the ImageTools package and I had already replayed some of the examples it contains, but without digging deeper. In fact I thought it was essentially used to manipulate kind of jpeg or png images.
That's why I didn't think of it as a potentially useful tool for my problem.

Using Convolution is therefore a good advice.

Concerning the "bins" issue, the correct way to address it would be to have a 2D KernelDensity function (every trick like smoothing or filtering a "binned" scatterplot introduces artifacts that can lead to misinterpretations).
There is such a function in R and I think I could translate it into MAPLE, as I already did for a few other algorithims.
In case I do I will publish it in a specific Post.

​​​​​​​Thanks again for your involvement


Hi, I am now answering from my office.

I just found out your last post but, in the meantime, I have done a few things on my own.
Because of our security policy it takes me some time to transfer a file from my professional network on this open one, so no file given here.
I mainly worked on smoothing the original matrix NP for a better rendering.
Here his the code I made (the look-up table F is just an example among many matrices we can use ; I'm going to look at what ImageTools proposes)

Filtering := proc(M::Matrix(square))
  local N, MF, F, KP, nx, ny:
  uses LinearAlgebra:
  KP := KroneckerProduct:
  N := numelems(M[1]):
  MF := copy(M):
  F := Matrix(3$2, [[1, 2, 1], [2, 4, 2], [1, 2, 1]]):
  for nx from 2 to N-1 do
    for ny from 2 to N-1 do
      MF[nx, ny] := KP(M[nx-1..nx+1, ny-1..ny+1]; F):
    end do:
  end do:
  return MF:
end proc:

NPF := Filtering(NP)

Used in plots:-surfdata, this filtered matrix NPF looks rather pretty (prtty doesn't mean correct of course).

I will continue to work on this idea with all the material you sent me.
See you later


For your particular case (S=1, because I do not know how the "conditions" write for S > 1);
(Here the result is obviously 3)

# These 2 lines with Sum only serve to obtain concise outputs
Expr := (J, S) -> Sum(Sum(Sum(pi[i,j,k,F], i=1..J), j=1..J), k:1..S);
Rel := (j,k,J) -> Sum(pi[i,j,k,F],i=1..J)=1;

expr := (J,S)  -> eval(Expr(J,S), Sum=sum):
rel := (j, k, J) -> eval(Rel(j, k, J), Sum=sum):  # could be a function of (j, j, J, S)

e := expr(3, 1);
for j from 1 to 3 do
  e := algsubs(rel(j, 1, 3), e)
end do;

For S > 1 you could maybe inspire yourself from this ?


Thanks for your reply but the worksheet will only shows that I'm not bullshitting.
The real issue is about the lost of connection to the mpython server.
Either it is something already identified by the development team (or any mapleprimes member) or something that is due to the way Maple is installed on my machine.




Thank you acer, it's very usefull.
A classical example I often meet is the following: randomly select a column or a row of a matrix according to some probability distribution.
I almost systematically forget the necessary conversion of hfloats into integers.

@Carl Love 

Thanks for the reply.
Due to intranet  problems I couldn't use Maple when I sent you my question, so I thought that trunc did the truncation on hfloats... when in fact the conversion to a sequence does the conversion to a sfloat and trunc "only" does the truncation.
Thanks also for the last paragraph of your answer, I'm going to take a look at this package and at evalhf.


@Carl Love 


I'm always worried by the fact a discrete random variable, even when defined on integers (think to a binomial one), always returns a float (contrary to random(...) for instance).
Neither round, floor nor ceil can convert these outputs into integers, so "my" UseHardwareFloats := false.
Couldn't  it be interesting that these three functions also operate on hfloats?


(mmcdara from my professional account)

Thanks dharr, astute way to reduce the computing time indeed.


(mmcdara from my professional account)

Thanks for the link, I'm going to look at it right now

@Preben Alsholm 

Thanks Preben for reporting me this error (I'm mmcdara now using my profesional account).
I indeed did this work at home with Maple 2015.2

Thank you again forhaving fix this bug for more Maple 2020.
As I'm at the office now I will test this with 2018 and 2019.


I don't feel offended.

About OBSERVE, the idea is the following :

I'm working on a course about  probabilities and statistics  for internal purposes within my company. I have decided to construt this course around Maple in order to be able to present formal results and numerical approaches.
This course will begin with the basis, for instance what is a random variable (RV) ? and will present some examples.
My firs idea was to use the Start[Statistics][ContinuousDistributions] application. But I thought it would be smarter to have sliders to instanciate a RV, and to display the values of some of its statistics as thes sliders move.

I then imagined to write this procedure OBSERVE taking as parameter the RV a "student" would like to see.

But youy may be right, I have imagined a too more complex way to do this by passing the distribution as a parameter?

1 2 3 4 5 6 7 Last Page 1 of 15