Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 104 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@vv This doesn't address the main issue: that the intermediate assignment to myD is necessary. The curry isn't doing anything special here. We still have that

myPDF := (v,t) -> piecewise(t < 0, 0, t < v, 1/v, 0):
Statistics:-Mean(Statistics:-Distribution(PDF = curry(myPDF, 1)));

produces the error.

@MortenZdk It doesn't work because fsolve requires a numeric x.

@adrian5213 

You need to compensate for the extra square brackets that you added in the previous step. So the next step should be Do(C= table(HD)) instead of Do(C= table([HD])). However, I'll defer to Acer on this point, if he has anything more to say.

@Markiyan Hirnyk 

A:= Array((1..3)$3,  (i,j,k)-> x[i,j,k]);

would be a more-appropriate analog to the symbol option of Matrix and Vector.

@tomleslie The OP was probably trying

plot(Prev(p), p= 0..1);

@Joe Riel Markiyan is referring to the Active Conversations menu. It gives only the title lines.

@MortenZdk You have 10 reputation points now. Also, it doesn't require any reputation points to select an Answer as the Best Answer.

Here's how to get the delta in your matrix in the context of your code. In the code below, note carefully how I changed the first D to d in each equation. And note that I changed solve to eliminate. In the final eval, I added another outer eval to change the ds back to Ds.

restart:

derivation := proc(A::Array)
local
     i, j, k, m, s, D, d, delta,
     n:= op([2,2,2], A),
     _D:= Matrix((n,n), symbol= D),
     _d:= Matrix((n,n), symbol= d),
     sols:= [eliminate(
          {seq(
               seq(seq(add(A[k,j,m]*d[k,i]+delta*A[i,k,m]*D[k,j], k= 1..n), m= 1..n), j= 1..n),
               i= 1..n
          )},
          indets(_d)
     )]
;
     userinfo(1, ':-sols', NoName, print('sols'= sols));
     seq(eval(eval(_d, s[1]), convert(_d=~ _D, set)), s= sols)
end proc:

AS1:= Array(((1..2)$3), {(1,1,2)= 1}):
infolevel[sols]:= 1:
derivation(AS1);

sols = [[{d[1, 1] = -delta*D[1, 1], d[1, 2] = 0, d[2, 1] = d[2, 1], d[2, 2] = d[2, 2]}, {delta*D[1, 2]}]]

Matrix([[-delta*D[1, 1], 0], [D[2, 1], D[2, 2]]])

 

Download derivation.mw

Now this may still not be what you want because you want D[2,1] to be 0.

@farahamirah Just enter it:

A:= <-delta*D11, 0; 0, D22>;

@mskalsi Here's one that works on both forms

Delta:= e->
     if e::algebraic then diff(e,y,x,x) + diff(e,y,x) + diff(e,y,z,z) + diff(e,x,x) + diff(e,z,x,x)
     else (D[2,1,1] + D[2,1] + D[2,3,3] + D[1,1] + D[3,1,1])(e)
     end
if
:

Note that the D form relies on the positions of the function's parameters. It does not care whether you use x, y, or z. On the other hand, diff relies on the names being x, y, z and doesn't care about their order (they don't even have an order).

@mskalsi The D form is only intended to used when f is a function, not an expression.

If you want a differential operator that works on expressions (and won't work on functions), use

Delta:= e-> diff(e,y,x,x) + diff(e,y,x) + diff(e,y,z,z) + diff(e,x,x) + diff(e,z,x,x):

 

 

While all these ways of formatting the output are great, I still think that the OP's problem is not using multiplication operators in the input. It'd be great if they'd upload a worksheet instead of posting a picture on tinypic.com.

@jwitte1996 We'll need to see the code of proedure OrderB. But my strong suspicion is that you mistakenly put its output in a print statement.

@Markiyan Hirnyk Thanks, that works for me.

The problem with using Statistics:-MaximumLikelihoodEstimate is that I know of no way within the Statistics package to create a parametrized custom distribution.

Also, what is the variable t?

Edit: Markiyan has cleared up the issue of using MaximumLikelihoodEstimate with parametrized distributions, so once you tell me what t is doing in your formula, we can get to work using it.

First 422 423 424 425 426 427 428 Last Page 424 of 709