Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 358 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@mmcdara What you call "reduced uncertainty" is not normalized to N[*1], making it difficult to put into context. I think that it should be converted to p-values as commonly used in hypothesis testing of proportions. I've done this, making the code:

SampleCheck:= proc(X, N::posint)
uses St= Statistics;
local
    p:= 10.^~[$-6..-1],
    S:= St:-Sample(X, N),
    Obs:= rhs~(St:-TallyInto(S, `..`~(min(S)-1, St:-Quantile~(X, p, 'numeric')))), 
    Exc := N*~p,
    #Compute two-tailed p-values using Normal approx to binomial:
    U:= 1 -~ abs~(1 -~ 2*St:-CDF~(Normal~(Exc, sqrt~(Exc*~(1-~p))), Obs))
;
    printf("  prob      exact    observed           p-value \n");
    printf~(
        "%1.1e  %8d %11d           %0.4e %s\n", 
        p, round~(Exc), Obs, U, `if`~(U <~ 0.05, "****", "")
    );
    return
end proc
:

SampleCheck(Statistics:-RandomVariable(Normal(0,1)), 9*10^7);
  prob      exact    observed           p-value 
1.0e-06        90         353           0.0000e+000 ****
1.0e-05       900        2016           0.0000e+000 ****
1.0e-04      9000       10435           0.0000e+000 ****
1.0e-03     90000       90131           6.6219e-001 
1.0e-02    900000      899403           5.2708e-001 
1.0e-01   9000000     8996536           2.2356e-001 

[*1] Edit: Upon taking a closer look, I realized that the problem was that you made a mistake computing the standard deviation of the binomal. It should be sqrt~(Exc*~(1-~p)), whereas you had sqrt~(Exc). With this change, your "reduced uncertainty" makes sense. Still, I prefer to further process it to a p-value.

@alexk213 To do your symbolic sum, I found that it worked better to change piecewise to `if` and Integrate to int:

phi:= (j,x)-> `if`( #works better than piecewise in this case
    j=0, exp(x),
    int(exp((1-theta)*x)*theta^(j-1),theta=0..1)/(j-1)! #Note: int
):
phi(0,x)/x^j - sum(phi(i,0)/x^(j-i), i= 0..j-1);

The result of this is

exp(x)/x^j - exp(x)/x^j*GAMMA(j,x)/GAMMA(j)

Clearly, this is equivalent to 

exp(x)/x^j*(1 - GAMMA(j,x)/GAMMA(j))

although it's tricky to get Maple to put it in this exact form.

@sand15 In my opinion, Maple 2019 is the best version since objects were introduced (Maple 16?).

There was a major bug in the 2019.2 update (restart not reading initialization file). They very recently announced that it's been fixed. 

@alexk213 Sometimes to recompute a result at a higher precision, it is necessary to "clear" the lower-precision results from the remember tables. The easiest way is restart. More subtle clearing can be done with the forget command.

I can't confirm that this is the actual source of your anomaly without seeing your code and knowing your Maple version. Like the other respondents, I can't reproduce the anomaly.

@acer I suspect that the OP was simply unaware of the formula that the transpose of a product equals the reversed-order product of the transposes of the factors.

@Kitonum Your command works fine for this unusual case, and, indeed, it makes sense intuitively. However, it should be pointed out for unwary readers that if the input had been an actual series structure (as returned by series or taylor), which is the usual case, the remove command wouldn't work.

@acer I think that the OP has a good point in this case because 1) convert(..., polynom) is a confusing name and 2) this specific case is not a series structure.

A better convert command for converting series would be convert(..., `+`), but it doesn't work.

@mmcdara

Yes, it was my intention in posting the procedure that someone would use it to test the extreme-tail sampling of other continuous distributions, preferably with samples much larger than a million. 

The bug that oversamples the tails (at least for Normal(0,1)) is not so bad that you'd be able to detect it while using equiprobable bins. Instead, my bins were evenly spaced by standard deviations.

See the Wikipedia article "Ternary plot". I guess it's something they're working on. Perhaps there'll be a new value of option axescoordinates associated with it, akin to polarplot.

I spotted another error. Where you have condin[1,j], it should be condin[j].

@mmcdara The built-in command select (not Selectis very fast, but the non-built-in is is slow and totally unnecessary. You could replace your command with

select(`>`, S, q); 

But why do you ignore the extremely fast method that I show in an Answer below?

The compiler is now essentially built in and requires no separate installation. 

The names of the constants suggests to me that this is a problem in nano-magneto-fluid dynamics, one of the most common topics here on MaplePrimes (partly because the BVPs are often tricky to solve numerically to high accuracy). In my experience, all such problems start with third-order ODE BVPs. So, please post the original problem. I'd guess that you're trying to satisfy a boundary condition at time = infinity.

I don't understand how the final animation in your worksheet is not what you want. To me, it shows both curves moving at the same time.

@ActiveUser I'm sorry, but I can't understand what you're trying to say about logic. 

You asked earlier what "degree" meant. The degree of a permutation is the length of the lists that it operates on. Since fixed points are omitted from the disjoint-cycle representation, the degree of a permutation in that form cannot be known with certainty, so it must be supplied for some commands. All that we can say for sure is that the degree is at least the largest number that appears.

All the permutations in a group must be the same degree, so, naturally, this is also called the degree of the group.

@chinthak I have very little knowledge of tensors, and no experience whatsoever of using them in Maple. If you post for me a worksheet that creates a small tensor, I may be able to figure out how to convert an Array to a tensor.

First 239 240 241 242 243 244 245 Last Page 241 of 709