Hi,
I just stumbled over old hansl code by Jack that implements the
fractional power of a pd matrix (see at the end). The comment hints at
the plan to integrate this somewhere, but it never happened. Should it
go into the 'extra' addon?
thanks
sven
----
function matrix pdmatpower(const matrix A, scalar pow)
# Helper function by Jack Lucchetti to calculate
# a fractional power (e.g. root) of a pos-def matrix.
# Once this feature is in extra.gfn or in core gretl
# it can be retired.
matrix ret = {}
catch l = eigensym(A, &ret)
err = $error
if err
msg = sprintf("%d - %s", err, errmsg(err))
funcerr "@msg"
elif minc(l)<0
msg = sprintf("matrix %s is not pd", argname(A))
funcerr "@msg"
else
l = l .^ (pow/2)
ret = ret .* l'
ret = ret*ret'
endif
return ret
end function