sumofsquares1 {exams.forge}R Documentation

sumofsquares1

Description

Decomposes an integer n2 into a sum of squared integers (n2 = \sum_{i=1}^{nobs} x_i^2). If n is not NA then it is ensured that \sum_{i=1}^{nobs} x_i = 0. Note if nobs<=10 then the following data sets are available:

Usage

sumofsquares1(n2, nobs = 10, n = 0, x = runif(nobs), maxit = 1000)

Arguments

n2

integer: number to decompose as sum of squares

nobs

integer: length of return values

n

integer: additional sum condition (default: 0)

x

numeric: vector of nobs starting values (default: runif(nobs))

maxit

integer: maximal number of iterations

Value

A integer vector of length nobs.

Examples

sumofsquares1(100, 20)
sumofsquares1(100, 20)

[Package exams.forge version 1.0.10 Index]