-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
57 lines (43 loc) · 1.36 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# mathmodels
<!-- badges: start -->
<!-- badges: end -->
The goal of mathmodels is to create a mathematical modeling toolbox with R, implement common mathematical modeling algorithms: evaluation,
optimization, prediction, dynamics, graph theory, statistics,
intelligence, etc.
**Attention:** The package is currently only a very very early version!
## Installation
You can install the latest development version of `mathmodels` directly from
[GitHub](https://github.com/zhjx19/mathmodes) use:
``` r
library(devtools)
devtools::install_github("zhjx19/mathmodels")
```
Or download to current path, unzip and use:
``` r
install.packages("mathmodels-master", repos=NULL, type="source")
```
## Example
This is a basic example which shows you how to solve a AHP problem:
```{r example}
library(mathmodels)
# pairwise comparison matrix
A = matrix(c(1, 1/2, 4, 3, 3,
2, 1, 7, 5, 5,
1/4, 1/7, 1, 1/2, 1/3,
1/3, 1/5, 2, 1, 1,
1/3, 1/5, 3, 1, 1), byrow = TRUE, nrow = 5)
# return: Weight vector, Consistency ratio, Maximum eigenvalue, Consistency index
AHP(A)
```