Package 'numericalecon'

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

Help Index


Sum of two polynomials

Description

It sums two objects of class Quadra

Usage

addQuadra(Q1,Q2)
Q1%+%Q2

Arguments

Q1

An object of class Quadra.

Q2

An object of class Quadra.

Examples

P1 <- Quadra(1,2,3)
P2 <- Quadra(.1,-2,1.3)
P1

Plot second order polynomial

Description

It prints the polynomial and shows the min or max and the zeros.

Usage

## S3 method for class 'Quadra'
plot(x,from=NULL,to=NULL, ...)

Arguments

x

Object of class Quadra.

from

min(x) on the plot

to

max(x) on the plot

...

Argument for other type of objects

Examples

P1 <- Quadra(1,2,3)
plot(P1)

Print methods for Quadra

Description

Print results of different methods applied to Quadra Objects

Usage

## S3 method for class 'Quadra'
print(x, ...)
## S3 method for class 'zeros'
print(x, ...)
## S3 method for class 'solveP.Quadra'
print(x, ...)

Arguments

x

Onject of class Quadra.

...

Argument for other type of objects

Examples

P1 <- Quadra(1,2,3)
print(P1)
print(zeros(P1))
print(solveP(P1))

Object of class Quadra

Description

Create an object of class Quadra

Usage

Quadra(a,b,c)

Arguments

a

Coefficient A (see details)

b

Coefficient B (see details)

c

Coefficient C (see details)

Details

The polynomial is f(x)=Ax2+Bx+Cf(x)=Ax^2+Bx+C.

Examples

P1 <- Quadra(1,2,3)
P1

Roots of a polynomial

Description

Computes the roots of a second order polynomial

Usage

## S3 method for class 'Quadra'
solveP(obj, ...)

Arguments

obj

An object of class Quadra.

...

Other arguments when solve is applied to another class object

Examples

P1 <- Quadra(1,2,3)
solveP(P1)

Summary for objects of class Quadra

Description

Returns characteristics of the polynomial

Usage

## S3 method for class 'Quadra'
summary(object, ...)

Arguments

object

An object of class Quadra

...

Argument for other type of objects

Examples

P1 <- Quadra(1,2,3)
summary(P1)

Zeros of a second order polynomial

Description

Computes the zeros of polynomials of class Quadra

Usage

## S3 method for class 'Quadra'
zeros(object, ...)

Arguments

object

An object os class Quadra

...

Other arguments when zeros is applied to an other class object

Examples

P1 <- Quadra(1,2,3)
zeros(P1)