490 Reputation

11 Badges

8 years, 72 days

MaplePrimes Activity

These are replies submitted by sand15


sorry for this late answer...

Thanks you vv


I do not have Maple 2017.
In Maple 2018.0, Windows 7 version, ID 1298750, using names returns an explicit error saying that strings are expected.

Maybe a slight change from one version to the next one...

@Carl Love @vv

You're 100% right.
I redid the exercice this morning, mind calm , and I clearly fooled myself yesterday.
I think it's not appropriate to chat on mapleprimes while watching a soccer's game


which is a real pity for loops are very common in probabilistic graphical models.
Of course you can always cheat by writting {1, x}, {x, 1} instead of {1, 1} and give ad hoc transitions probabilities to simulate a 1 to 1 transition, but it would not be smart at all.
Let me immediately moderate these comments: what is really intersting from a practical point of view is the transition matrix (which could be the adjencicy matrix in a zero-loop graph)... indeed, the graph here is more an educational suport than a computational tool.


Now from the office...

Worksheet, after a few personal modifications, works perfectly well.

Thank you very much acer

@Carl Love 

If you write sol := dsolve(...), isn't it the value of sol('numfun')  ?

Maybe you should take a look at the "LinearFit" help page.
This procedure can return a lot of different ouputs, among them there could be what you are looking for.
If not, could you be more specific about your problem?

@Preben Alsholm 

(mmcdara from professional account)

Thanks for your reply, it will prove very useful in the future.
The only thing that makes me reluctant to use assuming instead of assume is that you must repeat "assuming ..." everywhere it's necessary.



Sorry to reply from the office with the login sand15.


Mistake ot not mistake ?
I would even say  mistakes.

You wrote "I simply looked at the graph the OP wanted to fit and "eyeballed" a few obvious points through which the graph passed."
As a rule it's already a very bad idea, specially when you already have numerical values at hand (the one the OP used).
Next, it's not your job, nor mine, not the job of anyone else to replace, as you did, data by one's own data. If you were suspicious about the OP's for they did not match the graph, you would have point this fact to him before giving adetailed answer.
And finally, what makes you so sure that the data you used after "eyeballed a few obvious points" are good: as you have probably noticed, the graph the OP gave does not mention the scales of the axis.

To end this, susceptibility is poor counselor.
You wrote "You seem to believe that the OP's selected points are important..." : NO, I just used your own words you used in your first answer "The overall strategy is to identify about six "important" points".
Please avoid rewritting the past



I would have payed more attention to your example.
Thanks for the details.



Agree, at first sight this seemed strange to me for the command 2.3 just returns 2.3 and not 6. I've always believed that the "dot" operator only meant "multiplication" in document mode or when used as a matrix product

But I just saw that `.`(2,6) in worksheet mode


It's strange you get Matrix(3, 3, {(1, 1) = -1, (1, 2) = -1, (1, 3) = -1, (2, 1) = -2, (2, 2) = -2, (2, 3) = -2, (3, 1) = -3, (3, 2) = -3, (3, 3) = -3}) with the command Matrix(3, 3, `-`);

In my case (Maple2018, worksheet mode) I get

Matrix(%id = 18446746664292233078), just as with Matrix(3, 3, (i,j) -> i-j);


The result returned by  Matrix(3, 3, `.`); is very curious, would you have any idea about it?

@Carl Love 

Right Carl, good point (beta distribution) and nice work (the completely formal solution).

It would be interesting to try to generalize this formal derivation to non uniform pdf.

For some of them order distribution are known and I think it could be possible to obtain interesting results.

By the way, my last mistake was that I write Ecost as a sum of two terms invoking the integral of Q-x as I should have written that it was defined as the value work Wich these two integrals are equal.

I think it would be better to avoid integrating Q-x between a and Q and x-Q between Q and b: fundamentally this is the same loss function Q-x (or x-Q) that we use.


Hope it's clear, I send this from my smartphone


@cinderella look to my code and your code.

The only difference is the expression of N. I define N as the integral of Q-x against the measure f, as you define  this same N as the integral of x-Q against the measure f.

If you are sure of what you did change the sign of N in my code.

You can do this in the 'numerical' code l sent you yesterday or in the formal code I sent you nine hours ago (in this matter change the sign of MAX in the expression of Qstar) 

I have no doubt you will be capable to fix this by yourself. Now I'm in weekend, see you in two days if necessary.


Then you can use this
reference : Maple V, release 5, Monagan et al, 1996  page 55

uniform := proc(r::constant..constant)
  local intrange, f:
  intrange := map(x -> round(x*10^Digits), evalf(r) ):
  f := rand(intrange)
  (evalf @ eval(f)) / 10^Digits)
end proc:

# usage

N := 100:
U := uniform(1..N):
s := [seq(U(), n=1..N)]:
t := sort(s, output=permutation)

2 3 4 5 6 7 8 Last Page 4 of 16