sand15

355 Reputation

10 Badges

5 years, 129 days

MaplePrimes Activity


These are questions asked by sand15

Hi,
Can somebody explain me these strange results ?

 

restart:
with(Statistics):
X := RandomVariable(Normal(1.0, 1.0)):
S := Sample(X, 10):

# naively... but it's not what I was expecting for
#                maybe a misuse of the 'normalize=truefalse' option ????
Likelihood(Normal(1.0, 1.0), S);
       # a strange answer

# 2nd way
A := Likelihood(Normal(m, 1.0), S):
evalf(subs(m=1.0, A));
   # this is the good answer
   0.004387

# third way
Likelihood(Normal(1.0, 1.0), S, 'normalize=false');
   4.48e-7    # a wrong answer

 

Thanks for your enlightenment

Hi everyone,

I have a x -> y = f(x) function from R to R (you may suppose f is C(infinity)),  given by an explicit relation.
This function is not strictly monotonic over R.

I want to construct the global inverse of f over R by putting "side by side" local inverse functions.
Let a__0, ..., a__n values of x such that:

  1. -infinity =a__0 < a__1 < ... a__(n-1) < a__n = + infinity
  2. f is monotonic over ] a__p, a__(p+1) [   for each p=0..n-1

The idea is to define the global inverse g of f over R by
g := y ->  piecewise(y < f(a__1), g__0(y), ..., y < f(a__n), g__(n-1)(y))
where g__p(y), is the inverse function of the restriction of f to ] a__p, a__(p+1) [
 

Toy problem
f := x ->1-(1-x)^2;
x__1 := solve(diff(f(x), x);
y__1 := f(x__1);

# I thought one of these commands could work (but they don't return me a single branch as I had expected)
solve(f(x)=y, x) assuming y < y__1;
solve({f(x)=y, x < x__1}, x);

How can I obtain the inverse of a function f over an interval where f is bijective ?


TIA

 

 

 

I wrote this simple set of instructions  (Maple 2015 and Maple 2016)

restart:
p := x -> sum('a__||k' * x^k, k=0..5):
p(x);    # returns a0+ a1x +  ... + a5x5

p(1);   # returns a0+ ... + a5

p(0);   # returns 0 ...  not a0


Probably so huge a mistake that I can't see it !?!?!?

Could you please help me to fit it ?

TIA

Hi everybody,

Please take the example given in the help pages of DocumentTools[Tabulate] (the one where a cardinal sine is plotted)
Change plot(sin(x)/x) by plot(sin(x),/x, legend=sinc(x))

The legend doesn't appear if the list (named "A" in the help page) is displayed through DocumentTools:-tabulate.

Is it possible to circumvent this problem ?

TIA

Hi everybody,

I have written a module (let's say MyModule) that  I use as a package in a worksheet (with(MyModule)).

At some point in my worksheet I call the procedure MyProc which is part of MyModule.
I find it not to work as expected. So I modify it within MyModule and generate again the archive which contains this module.

Because my worksheet does a lot of things before the call to MyProc, I would like to test quickly the above modifications.
The idea is to do :
unwith(MyModule):  # packages() no longer exhibits its name
with(MyModule);      # to load the corrected one

Unfortunately, contrary to what happens with a "native" package,  the command unwith(MyModule) is ineffective:

  • once done showstat(MyProc) still displays the content of the procedure, and running  the command MyProc(...) proves that it still "exists" in the worksheet
     
  • forcing a reload of MyModule ( with(MyModule) ) and acanning again MyProc ( showstat(MyProc) ) reveals the code MyProc had when MyModule has been loaded for the first time.

 

Is it possible to "free" a user package through the "unwith" command ?

Hope to read you soon, TIA


PS : to be clearer

A worksheet contains  the definition of N procedures, plus the one of MyModule, and ends with the commands to generate an archive file named MyModule.mla.
MyModule is defined that way

MyModule := module()
option package

export Proc1 := eval(:-Proc1),
           ......
           MyProc := eval(:-MyProc),
           ......
           ProcN := eval(:-ProcN):
end module
 

 

First 7 8 9 10 11 12 13 Last Page 9 of 18