Carl Love

Carl Love

20853 Reputation

24 Badges

8 years, 194 days
Natick, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity

These are questions asked by Carl Love

How do I convert a hardware float to a software float? I have a procedure that is passed floats as arguments. They could be hardware or software floats. I need to set an attribute on these floats (with setattribute). Trying to use setattribute on a hardware float produces utterly bizarre results, although, strangely, not an error. But I'd be happy converting them to software floats and then setting the attribute. I tried (separately)

UseHardwareFloats:= false;

convert(x, float, 16);


And, FWIW, here's the procedure, although I doubt that it'll provide any more useful information than I've already given. Note that in this procedure I've redefined log to be the base-10 logarithm. (Not that that makes the slightest difference wrt my Question.)

LogView:= proc(viewspec::{range, identical(DEFAULT)}, Range::range)
local aV, bV, aP, bP, aL, bL;
     (aP,bP):= op(map(x-> 10^x, Range)); # The actual range of the ORIGINAL plot structure
     if viewspec = 'DEFAULT' then
          setattribute(op(1,Range), aP) .. setattribute(op(2,Range), bP)
          (aV,bV):= op(viewspec); #The user-specified view in the pre-log units
          if bV <= 0 then error "upper view limit must be positive; received %1.", bV fi;
          (aL,bL):= op(Range); #Actual range of the log plot structure
          setattribute(`if`(aV >= aP, log(aV), aL - (aP-aV)/(min(bP,bV)-aP)*(log(min(bP,bV))-aL)), aV) 

          .. setattribute(`if`(bV <= bP, log(bV), bL + (bV-bP)/(bP-max(aP,aV))*(bL-log(max(aP,aV)))), bV) 

     end if
end proc;

In the specific use instance that I'm dealing with, the first parameter, viewspec, is DEFAULT, and the second, Range, is HFloat(-43.42...)..HFloat(43.42...).

I think the ideal solution would be to use parameter coercion to convert the arguments.

I'll be vacationing in Amsterdam May 1-11. I was wondering if there are any Maple-related activities or institutions there that I might visit. I believe that the Netherlands has somewhat of a national drive toward the use of computer algebra in education, much more so than the United States. Can anyone here confirm that? And if that's true, is Maple a big part of it?

In doing multiple linear regression with Statistics:-LinearFit, how do I get or compute the values commonly called R^2 and R^2[adjusted], also known as the coefficient of determination? I know that residualsumofsquares is part of it. I also need the "total sum of squares" to compute R^2. And how do I modify that to get R^2[adjusted]? These things do not seem to be among the numerous output options to LinearFit. These values (R^2 and R^2[adjusted]) are typically part of the output of other statistics software when doing multiple regression.

I'd also like the p - values for the significance of the individual parameters and the p - value for the global utility---also things that are standardly reported by statistics software.

Both eval and showstat show that a procedure `print/diff` exists, but I am having trouble figuring out when the procedure is invoked. I expect it to be invoked---like any other `print/` procedure---when diff is output as an unevaluated function call. So I enter,

diff(f(x), x$2);

This does not produce any debug output. Why? Checking with lprint shows that the result does indeed contain diff as an unevaluated function call.

Looking at the code of PDEtools:-declare, one sees that it does some brief initializing and then passes the job off to `PDEtools/declare`. I'd like to view this latter procedure, but I can't find it. It is not at the top level, nor is it an export or local of module PDEtools. So where is it?

4 5 6 7 8 Page 6 of 8