Learn R Programming

modello (version 0.1.1)

ssq.modello_number: Sum of Squares

Description

Sum of square function $$ssq = \sum_i x_i^2$$

Usage

# S3 method for modello_number
ssq(x)

# S3 method for default ssq(x)

ssq(x)

Arguments

x

a 'numeric' or a reference object of class 'number'

Value

Returns a 'numeric' or reference object of class 'number'

Examples

Run this code
# NOT RUN {
modello.init(10, 10, 10, 10)
## For modello_numbers
x = number(rnorm(10))
y = ssq(x)
print(y)
print(y$v)
modello.close()
## For numerics
x = rnorm(10)
y = ssq(x)
print(y)
# }

Run the code above in your browser using DataLab