Comments (10)
I'm not familiar with the PHP license and what restrictions it has. For now please do not use any potentially restrictive licensed code.
I was planning on creating a LinearAlgebra namespace that would have vector and matrix operations. I can get started on that after merging and updating the recent changes if that works for you.
from math-php.
No worries, I wasn't planning on merging anything that I hadn't written. There are a few Matrix Libraries in composer that might work as starting points too. MIT License-Linear Algebra
from math-php.
I added an initial Math\LinearAlgebra namespace with Vector and Matrix classes. I still have some methods to add but it should be enough to get started working with. Let me know if you have any particular features you want added. Usage is documented in the main page README.
from math-php.
It definitely needs inverse and determinant before I can use it to expand the regressions. The Linear Algebra package I linked to above has everything I'd need. I requested some "Matrix Concatenation" methods from him a couple days ago and he added it very quickly.
from math-php.
Those are on my list of functions to implement.
from math-php.
Besides concatenation, another good matrix function would be "exclusion".
$M = new Matrix([[1,2,3,4,5],[2,3,4,5,6],[3,4,5,6,7]];
print $m->rowExclude(2);
// [[1,2,3,4,5],
// [3,4,5,6,7]]
print $M->columnExclude(3);
// [[1,2,4,5],
// [2,3,5,6],
// [3,4,6,7]]
Calculating the standard errors of multiple linear regression is simplified by using this.
from math-php.
I've been reading up on the MIT license, and it looks like we could just grab any matrix code from another MIT licensed project, and use it, as long as the original author's copyright is included. Since I've contributed a fair amount of code, I should probably get credit too. Would you object to pulling some matrix code into our project and modifying the project license?
from math-php.
I've slowly been working on adding the matrix operations by working it out. I added LU Decomposition, which will be a step in adding solving linear equations and doing inverse and determinant etc. It's been a long time since I've studied linear algebra so I've been relearning as I go.
I'd prefer that all code be original, and if you don't mind waiting, I'll try to get it done. Or, if you want to take a stab at it, that's cool too. I don't think there is anything preventing you from looking at someone else's code to learn the general logic of how something works (This is general math after all), and then write your own implementation.
Otherwise, if you want to start with the other person's code and modify it from there, we will have to include the license. Since this project is already MIT and I already have an MIT license in the root directory I don't think we need a second license file, since it isn't like we are incorporating GPL code or something, so I think we can give the original source credit in the method's Docbloc comments and that should suffice. If you know of some projects that do the same thing that we can verify on how to do it that would be helpful. Another option is to have the other author contribute here and do a pull request.
Btw, back when you first started contributing I added your name to the authors section of the composer file. For example, when you look at the project on any page that parses the composer manifest, such as Packagist, you will see it appear:
https://packagist.org/packages/markrogoyski/math-php
from math-php.
Looking around on the Web, it looks like how some people do it is if you copy the code verbatim, you want to site the source and provide the license text. This could be done at the top of the class that includes the included code or in the docblock of the method if it is just one method.
If you are going to reference it as a base of understanding to adapt the code or implement it on your own, it seems OK to site the source of the original code and give credit that it was used as a reference without needing to include the license, since the original licensed code was not used
I'm not an expert in this, but that seems reasonable to me.
from math-php.
I added an initial implementation of Matrix inverse, determinant and reduced echelon form. See if these work for you.
from math-php.
Related Issues (20)
- What is the point of the complex polar form? HOT 7
- Division by zero in Probability\Distribution\Continuous\Continuous HOT 21
- Dealing with NANs HOT 3
- Integer Modulo n HOT 3
- Add vector, matrix and quaternion operations for 3d geometry HOT 1
- Could math-php support KPHP? HOT 1
- Truncated Mean Percentage HOT 5
- Incompatibility with Iterator and ArrayAccess interfaces HOT 1
- Quartiles calculation in Stats Descriptive HOT 1
- MiddlePayment For Loan HOT 2
- `number` is not a valid PHP type HOT 5
- Kernel Density Estimation: Improved Sheather-Jones algorithm HOT 4
- Bug for the t-test? HOT 5
- Add row/column algebra methods to Matrix for Vector HOT 3
- Document additional Matrix Row Operations and add their Columnar counterparts HOT 5
- Implicit Behavior of ImmutableSet
- Add Moore-Penrose Inverse HOT 12
- Psalm does not understand `number` pseudo-type HOT 3
- Add a factor method for Polynomials HOT 4
- Repeated measures ANOVA HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from math-php.