Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Markiyan Hirnyk The error comes from Probability, not from my procedure. Would you expect me to rewrite that also? The Mathematica conditioning operator is just an add-on to its probability command. Likewise, my procedure is an add-on to Probability. It does correctly handle whatever multivariable cases Probability handles.

The situation is far from ideal, but you can't blame me for the longstanding deficiencies of Probability.

When I have access to a computer, rather than my phone, I will correct the case where FAIL/FAIL simplifies to 1.

@Markiyan Hirnyk 

I don't have Mathematica, so I can't check which cases it handles; so, I made it at least robust enough to handle the single example given in the Question.

My procedure (as originally posted) handles the multivariable case when the random variables have already been declared. To handle the other case---that the variables are being declared directly in the third argument (similar to an assuming clause), requires only a trivial modification:

Conditioned:= proc(
   event::{relation, set(relation)},
   cond::{relation, set(relation)}, 
   rv::
      {name= RandomVariable &under Statistics:-RandomVariable,
       {set,list}(name= RandomVariable &under Statistics:-RandomVariable)
      }
) 
uses St= Statistics;
local 
   Event:= `if`(not event::set, {event}, event),
   Cond:= `if`(not cond::set, {cond}, event),
   RV:= `if`(not rv::{set,list}, [rv], [rv[]]) 
;
   if nargs=3 then 
      (Event,Cond):= 
         subs(lhs~(RV)=~ St:-RandomVariable~(rhs~(RV)), [Event, Cond])[]
   fi;
   #union used rather than intersection because Probability considers a set
   #of relations the represent the intersection of the corresponding events. 
   St:-Probability(Event union Cond)/St:-Probability(Cond)
end proc:

 

@BigBugBuzz I think that it'd be best to avoid applying evalf to expressions containing RootOf because it'll generally only give you one result when there are many. Rather, you need to isolate roots to intervals, possibly complex intervals.
            

@tomleslie I think that you intended to include an argument w = 0..1 to your fsolve, but that you forgot it.

 

@ibndirac Sorry, I misterpretted something---not something that you wrote but some Maple output. My Dirac comment was totally irrelevant.

I suppose that you think of diff(g(x,t), x) as some sort of Dirac-like function, right?

@Annonymouse The dimension of a solution returned by solve is the number of its vacuous equations.

@brian bovril Change the declaration for Games in procedure Update to

Games::list({
      [{name,string}, {name,string}],
      [{name,string}, {name,string}, anything]
   }),

And change the updating line to

(R[G[1]], R[G[2]]):= ELO(R[G[1]], R[G[2]], G[3..][])

By the way, Elo is not an initialism or acronym. It's named after the person who invented it, Arpad Elo. So it'd be more proper to spell it Elo rather than ELO.

@maple2015 You said that the Z values were experimentally determined, yet when the fitted model function deviates from those Z values, you call it an "error". Those two things are not consistent with each other. If you're going to use regression, then you must accept that the Z values themselves have error and that the best model function may not pass through any of them. To do otherwise is bad science and often a morally corrupt business / engineering practice (part of "lying with statistics").

The difference between the z-value obtained from the model function and the corresponding experimental z is called a residual.

The difference between an experimental z-value and its true (but unknown) value is called an error. By true value, I mean the mean of all possible experimental values at the given x and y.

If you want to give more weight to certain z-values, it can be done with the weights option to LinearFit. I wouldn't consider it corrupt if certain values were given more weight because they had been experimentally verified more times. Indeed, if W were the weights vector, you could just let W[i] be the number of times that Z[i] had been verified.

By the way, I'm not trying to argue that any of the models that I've proposed are correct. I wouldn't claim that any model is correct without there being some scientific basis for the inclusion of each of its terms. Rather, I'm arguing that your reason for rejecting models is wrong.

@maple2015 Ah, now that you've said that X and Y are both ratios, and, even better, that they have a common factor (the amount of cement), it's clear to me that a good model to try is multiplicative rather than additive: Z = C*X^p*Y^q, where C, p, and q are values to be determined. It's done with logarithms like this:

lnZ:= Statistics:-LinearFit([1, ln(x), ln(y)], < X | Y | ln~(Z) >, [x,y], summarize);
Summary:
----------------
Model: -12.751403+5.0633641*ln(x)-8.0127107*ln(y)
----------------
Coefficients:
              Estimate   Std. Error  t-value   P(>|t|)
Parameter 1   -12.7514    1.6204     -7.8693    0.0000
Parameter 2    5.0634     1.3071      3.8739    0.0017
Parameter 3   -8.0127     0.7647     -10.4783   0.0000
----------------
R-squared: 0.8927, Adjusted R-squared: 0.8774

Model:= simplify(exp(lnZ));
     Model := 0.289825157651345e-5*x^5.063364078/y^8.012710653

 

 

You must learn to do by hand the solving of pairs of linear simultaneous equations by using (Gaussian) elimination of 2x3 matrices of simple real fractions to put those matrices into row-echelon form and reduced row-echelon form (RREF). There's no point in asking questions about higher-level topics like QR until you understand RREF. Nearly every problem in finite-dimensional linear algebra can be answered (at least in principle) by finding the RREF of some matrix. RREF is not always the most computationally efficient method, but it's almost always the best way to get the exact answer by hand computation.

@shakuntala Rouben did put a link to the software in the second line of his Answer. See the blue word Imagemagick? Words in blue amongst otherwise black text are almost always links.

@asa12 I'm sorry, but you just ask too many questions all at once, and I'm tired. Maybe someone else can answer. Please learn some basic undergraduate level (sophomore level) linear algebra. Learn how to find the eigenvalues and eigenvectors of a 2x2 matrix exactly by hand computation. Learn what symmetric and hermitian matrices are. Learn what the characteristic polynomial of a matrix is. All of these things can be easily learned by Googling. Personally, I think that Wikipedia is the best place to start learning a math topic (or just about any academic topic). There are a lot of math videos on YouTube also, but personally I find the pace much too slow.

By the way, you are by far the number one question asker of all time on MaplePrimes. And I'd guess that 1/3 to 1/2 of your Questions somehow involve matrices and the LinearAlgebra package. So it's quite odd that you don't know what a symmetric matrix is. A little bit of academic study of linear algebra would save you a huge amount of time posting questions and going in logical circles with Maple.

I may be wrong about this, but I don't recall you ever acknowledging that you understood an answer that you've got here, that you learned something. Nor do I recall you ever giving an Answer a Vote Up. Instead, it seems that most answers are just met with a barrage of new questions. All of these things make it tiring and frustrating for the people who answer your questions.

@asa12 I don't know specifically about physics, but what size of matrices are you generally interested in? I'd use a float-point matrix for anything larger than a "toy" size because the algorithms for rational matrices are based on finding the roots of a high-degree polynomial. Those are usually unstable.

If the matrix is symmetric, then by declaring it so (with option shape= symmetric to Matrix) a better algorithm will be used by Maple.

@Muhammad Usman If (and only if) the polynomial has a double root, then the antiderivative can be expressed in terms of the hyperbolic arctangent. Indeed, the expression is relatively simple. The conditions required could be expressed as conditions on your coefficients d[i], but they don't depend on the on whether the roots or the coefficients are real.

If the polynomial has three distinct roots, I think that the answer can only be expressed in terms of Elliptic functions.

First 321 322 323 324 325 326 327 Last Page 323 of 708