| Title: | Numerical Methods for Economists |
|---|---|
| Description: | This package includes tools and functions used in the numerical course offered at the University of Waterloo |
| Authors: | Pierre Chausse <[email protected]> |
| Maintainer: | Pierre Chausse <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.0-1 |
| Built: | 2026-09-25 18:57:41 UTC |
| Source: | https://codeberg.org/pchausse/numericalecon |
It sums two objects of class Quadra
addQuadra(Q1,Q2) Q1%+%Q2addQuadra(Q1,Q2) Q1%+%Q2
Q1 |
An object of class |
Q2 |
An object of class |
P1 <- Quadra(1,2,3) P2 <- Quadra(.1,-2,1.3) P1P1 <- Quadra(1,2,3) P2 <- Quadra(.1,-2,1.3) P1
It prints the polynomial and shows the min or max and the zeros.
## S3 method for class 'Quadra' plot(x,from=NULL,to=NULL, ...)## S3 method for class 'Quadra' plot(x,from=NULL,to=NULL, ...)
x |
Object of class Quadra. |
from |
min(x) on the plot |
to |
max(x) on the plot |
... |
Argument for other type of objects |
P1 <- Quadra(1,2,3) plot(P1)P1 <- Quadra(1,2,3) plot(P1)
Print results of different methods applied to Quadra Objects
## S3 method for class 'Quadra' print(x, ...) ## S3 method for class 'zeros' print(x, ...) ## S3 method for class 'solveP.Quadra' print(x, ...)## S3 method for class 'Quadra' print(x, ...) ## S3 method for class 'zeros' print(x, ...) ## S3 method for class 'solveP.Quadra' print(x, ...)
x |
Onject of class |
... |
Argument for other type of objects |
P1 <- Quadra(1,2,3) print(P1) print(zeros(P1)) print(solveP(P1))P1 <- Quadra(1,2,3) print(P1) print(zeros(P1)) print(solveP(P1))
Create an object of class Quadra
Quadra(a,b,c)Quadra(a,b,c)
a |
Coefficient A (see details) |
b |
Coefficient B (see details) |
c |
Coefficient C (see details) |
The polynomial is .
P1 <- Quadra(1,2,3) P1P1 <- Quadra(1,2,3) P1
Computes the roots of a second order polynomial
## S3 method for class 'Quadra' solveP(obj, ...)## S3 method for class 'Quadra' solveP(obj, ...)
obj |
An object of class |
... |
Other arguments when |
P1 <- Quadra(1,2,3) solveP(P1)P1 <- Quadra(1,2,3) solveP(P1)
Returns characteristics of the polynomial
## S3 method for class 'Quadra' summary(object, ...)## S3 method for class 'Quadra' summary(object, ...)
object |
An object of class |
... |
Argument for other type of objects |
P1 <- Quadra(1,2,3) summary(P1)P1 <- Quadra(1,2,3) summary(P1)
Computes the zeros of polynomials of class Quadra
## S3 method for class 'Quadra' zeros(object, ...)## S3 method for class 'Quadra' zeros(object, ...)
object |
An object os class |
... |
Other arguments when |
P1 <- Quadra(1,2,3) zeros(P1)P1 <- Quadra(1,2,3) zeros(P1)