[julia-users] Re: Bang version of inv and BLAS

2016-09-06 Thread Mirmu
I know I should avoid the inversion, but in that particular case (inference 
over a multi dimensional gaussian model) I did not manage to avoid 
computing the full precision matrix. But thx for the suggestion :)
While there are bang version of inv! for specific structures (triangular), 
would be nice to provide an easier way to give a placeholder for the 
inversion.

 


Le mardi 6 septembre 2016 15:57:32 UTC+2, Steven G. Johnson a écrit :
>
>
>
> On Monday, September 5, 2016 at 1:52:40 PM UTC-4, Mirmu wrote:
>>
>> I am currently needing a loop, keeping track of two large matrices. 
>> One is a container for a Cholesky Factor F, and I update it using the 
>> on-place version lowrankupdate!.
>> The other one is its inverse, say M, that I can compute simply doing 
>> inv(F). 
>>
>
> (If you have the cholesky factor, why are you computing the inverse? 
>  Almost anything you might want to do with the inverse matrix can be done 
> more efficiently with the Cholesky factor directly.) 
>


[julia-users] Re: Bang version of inv and BLAS

2016-09-06 Thread Mirmu
Nevermind, I think I found a way around, from the source code of inv!

>From F the cholesky, one can overwrite M by F.factors -> copy!(M,F.factors)
Then call the LAPACK function potri!('U',M) that overwrites M by its 
inverse in the upper triangular.
And finally call copytri! to recover the full inverse.

Best.



[julia-users] Bang version of inv and BLAS

2016-09-05 Thread Mirmu
I am currently needing a loop, keeping track of two large matrices. 
One is a container for a Cholesky Factor F, and I update it using the 
on-place version lowrankupdate!.
The other one is its inverse, say M, that I can compute simply doing 
inv(F). 

I was looking for a version that would compute inv(F) while overwriting M, 
something like inv!(M,F), but I cannot find it in the BLAS functions.
If it does not exist, what would be the best to avoid allocate memory ? 
Keeping a third container with a copy of the Choslesky ? I am a bit afraid 
of the switch in type that occurs when applying inv to a CholeskyFactor 
object.

Any clue would be very appreciated :)
Thank you !




[julia-users] Re: Distributions.jl : generating samples from stable distributions

2016-08-23 Thread Mirmu
Thx a lot !



Le lundi 22 août 2016 23:19:11 UTC+2, Rock Pereira a écrit :
>
> RCall is a simple two-step process:
>
>1. Write the R script inside Julia's R macrostrings
>2. Copy the objects in R as objects in Julia
>
> The documentation is just one page. 
> http://juliastats.github.io/RCall.jl/latest/gettingstarted/
>
> R has a massive collection in its Distributions Task View 
> http://lib.stat.cmu.edu/R/CRAN/web/views/Distributions.html
> Search (press F3) for 'stable' to find other packages.
>
> If you're dealing only with draws from the Levy distribution (and not the 
> whole family of stable distributions) 
> you can do it in Julia: http://distributionsjl.readthedocs.io/en/latest/
>
> using Distributions
> x = rand(Levy(u, c), numSamples)
>


[julia-users] Re: Distributions.jl : generating samples from stable distributions

2016-08-22 Thread Mirmu
Ok, after a glance at the literature, I understand those distributions are 
quite tricky to sample from.
Using RCall might be a bit overkill.
Maybe 
http://prac.im.pwr.wroc.pl/~hugo/publ/AWeronRWeron95_LNP.pdf
would be an easy (if slow) way ? (although I am not a statistician so I 
cannot judge its accuracy). I could give it a shot for the package if you 
feel it's worthy

Best


[julia-users] Distributions.jl : generating samples from stable distributions

2016-08-19 Thread Mirmu
I am looking for generating samples from the stable Levy family with 
Distributions.jl, but I cannot find it.
https://en.wikipedia.org/wiki/Stable_distribution

Did I miss it, or there is a reason why it is not yet implemented ?

Best