Re: Mir simple linear

2020-03-30 Thread 9il via Digitalmars-d-announce

On Monday, 30 March 2020 at 17:21:57 UTC, Vino wrote:

Hi All,

  Can anyone  guide me what is the problem  with below code as 
it throws  error.


import std.stdio, mir.math.common: approxEqual;
static immutable x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
static immutable y = [1, 3, 2, 5, 7, 8, 8, 9, 10, 12];
auto params = x.simpleLinearRegression(y);
writeln(params);


static immutable y = [1.0, 3, 2, 5, 7, 8, 8, 9, 10, 12];

`.0` will change the sum type of y to double.


Re: Mir simple linear

2020-03-30 Thread jmh530 via Digitalmars-d-announce

On Monday, 30 March 2020 at 17:47:19 UTC, jmh530 wrote:


[snip]


The relevant function signature is

@safe sumType!YRange[2] simpleLinearRegression(XRange, 
YRange)(XRange x, YRange y)
if (isInputRange!XRange && isInputRange!YRange && 
!(isArray!XRange && isArray!YRange) && 
isFloatingPoint!(sumType!YRange));


and when you pass an int[] for y, then it determines that int is 
not a floating point and you get an error about not matching the 
signature, nothing about why you're not matching it.


A good example of where Atila's concepts library would be 
helpful...


Re: Mir simple linear

2020-03-30 Thread jmh530 via Digitalmars-d-announce

On Monday, 30 March 2020 at 17:21:57 UTC, Vino wrote:

Hi All,

  Can anyone  guide me what is the problem  with below code as 
it throws  error.


import std.stdio, mir.math.common: approxEqual;
static immutable x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
static immutable y = [1, 3, 2, 5, 7, 8, 8, 9, 10, 12];
auto params = x.simpleLinearRegression(y);
writeln(params);


This should be in the Learn forum.

As far as I can tell, the problem is that x and y are both type 
immutable(int[]), which it cannot handle. I tried just turning 
them into slices, but that wasn't sufficient, I had to ensure 
they were double as well (float would also work). Note that the 
example in the document uses a y variable that is a floating 
point type.


/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.25"
+/
import std.stdio : writeln;
import mir.math.stat : simpleLinearRegression;
import mir.ndslice : sliced;

void main() {
auto x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].sliced!double;
auto y = [1, 3, 2, 5, 7, 8, 8, 9, 10, 12].sliced!double;
auto params = x.simpleLinearRegression(y);
writeln(params);
}


Mir simple linear

2020-03-30 Thread Vino via Digitalmars-d-announce

Hi All,

  Can anyone  guide me what is the problem  with below code as it 
throws  error.


import std.stdio, mir.math.common: approxEqual;
static immutable x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
static immutable y = [1, 3, 2, 5, 7, 8, 8, 9, 10, 12];
auto params = x.simpleLinearRegression(y);
writeln(params);



Re: Mir updates

2020-03-30 Thread 9il via Digitalmars-d-announce

On Monday, 30 March 2020 at 12:23:03 UTC, jmh530 wrote:

On Monday, 30 March 2020 at 06:33:13 UTC, 9il wrote:

[snip]


Thanks, I like 'em.

I noticed that the little icon in the tabs has changed from 
most of them. However, the mir random is unchanged from before.


Probably it is because of your browser cache, likely will be 
updated after a while.


Also, on the mir.glas page, one of the lines says 
"matrix-vector operations %3 done, partially optimized for 
now". Another line says "l3 was moved to mir-glas", which is 
confusing because it should be at the mir-glas documentation 
page anyway.


We don't have documentation for mir-glas library, only for mir 
(backports) package, which has mir.glas package.


I don't know what to do with mir-glas, it is too good to be 
forgotten, but I don't see a commercial perspective in it.


Re: Mir updates

2020-03-30 Thread jmh530 via Digitalmars-d-announce

On Monday, 30 March 2020 at 06:33:13 UTC, 9il wrote:

[snip]


Thanks, I like 'em.

I noticed that the little icon in the tabs has changed from most 
of them. However, the mir random is unchanged from before.


Also, on the mir.glas page, one of the lines says "matrix-vector 
operations %3 done, partially optimized for now". Another line 
says "l3 was moved to mir-glas", which is confusing because it 
should be at the mir-glas documentation page anyway.




Re: Mir updates

2020-03-30 Thread 9il via Digitalmars-d-announce

On Monday, 30 March 2020 at 06:33:13 UTC, 9il wrote:

Docs and links have been updated for

http://mir-algorithm.libmir.org, Mir Algorithm
http://mir-core.libmir.org, Mir Core
http://mir-random.libmir.org, Mir Random
http://mir-optim.libmir.org, Mir Optim
http://mir-cpuid.libmir.org, Mir CPUID
http://mir-blas.libmir.org, Mir BLAS
http://mir-lapack.libmir.org, Mir LAPACK
http://mir.libmir.org, Mir Backport
http://asdf.libmir.org, ASDF - JSON library



and
http://mir-integral.libmir.org/


Re: Mir updates

2020-03-30 Thread Yazan D via Digitalmars-d-announce

On Monday, 30 March 2020 at 06:33:13 UTC, 9il wrote:

Docs and links have been updated for

http://mir-algorithm.libmir.org, Mir Algorithm
http://mir-core.libmir.org, Mir Core
http://mir-random.libmir.org, Mir Random
http://mir-optim.libmir.org, Mir Optim
http://mir-cpuid.libmir.org, Mir CPUID
http://mir-blas.libmir.org, Mir BLAS
http://mir-lapack.libmir.org, Mir LAPACK
http://mir.libmir.org, Mir Backport
http://asdf.libmir.org, ASDF - JSON library

[...]


Thanks for your work!


Mir updates

2020-03-30 Thread 9il via Digitalmars-d-announce

Docs and links have been updated for

http://mir-algorithm.libmir.org, Mir Algorithm
http://mir-core.libmir.org, Mir Core
http://mir-random.libmir.org, Mir Random
http://mir-optim.libmir.org, Mir Optim
http://mir-cpuid.libmir.org, Mir CPUID
http://mir-blas.libmir.org, Mir BLAS
http://mir-lapack.libmir.org, Mir LAPACK
http://mir.libmir.org, Mir Backport
http://asdf.libmir.org, ASDF - JSON library

I have started this a year ago and recently I got time to finish 
this work.


All of the libraries above have:
1. Meson and dub support
2. Imports validation for documented examples
3. AWS S3 + Circle CI automated documentation updates

Mir Optim was completely reworked and got Box Constrained QP 
Solver


ASDF, mir-algorithm, mir-lapack, mir-random, mir-core have been 
extended


---

This work has been sponsored by Symmetry Investments and Kaleidic 
Associates.


http://symmetryinvestments.com/
https://github.com/kaleidicassociates