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:
-
sos100=sumofsquares(100, 10, zerosum=TRUE, maxt=Inf)
, -
sos200=sumofsquares(200, 10, zerosum=TRUE, maxt=Inf)
, -
sos400=sumofsquares(400, 10, zerosum=TRUE, maxt=Inf)
, -
sos800=sumofsquares(800, 10, zerosum=TRUE, maxt=Inf)
, and -
sos1000=sumofsquares(100, 10, zerosum=TRUE, maxt=Inf)
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: |
x |
numeric: vector of |
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]