ID EN
Miscellaneous

norm

R Base 3.6.2 🇮🇩 Bahasa Indonesia

Menghitung norma matriks x menggunakan LAPACK. Norma dapat berupa norma satu ("O"), norma tak terhingga ("I"), norma Frobenius ("F"), modulus maksimum ("M") di antara elemen-elemen matriks, atau norma “spektral” atau “2”, yang ditentukan oleh nilai tipe.

Syntax

R
norm(x, type = c("O", "I", "F", "M", "2"))

Arguments

Parameter Deskripsi
x numeric matrix; note that packages such as Matrix define more norm() methods.
type character string, specifying the type of matrix norm to be computed. A character indicating the type of norm desired. "O", "o" or "1"specifies the one norm, (maximum absolute column sum); "I" or "i"specifies the infinity norm (maximum absolute row sum); "F" or "f"specifies the Frobenius norm (the Euclidean norm of x treated as if it were a vector); "M" or "m"specifies the maximum modulus of all the elements in x; and "2"specifies the “spectral” or 2-norm, which is the largest singular value (svd) of x. The default is "O". Only the first character of type[1] is used.

Return Value

Norma matriks, bilangan non-negatif.

Details

Metode dasar norm() memanggil fungsi LAPACK danlange. Perhatikan bahwa norma 1-, Inf- dan "M" lebih cepat dihitung daripada norma Frobenius. Hasil yang gagal dari kode LAPACK yang mendasarinya akan menghasilkan kesalahan yang memberikan kode kesalahan positif: ini hanya dapat diinterpretasikan dengan mempelajari kode FORTRAN secara mendetail.

Contoh

Example
R
# NOT RUN {
(x1 <- cbind(1, 1:10))
norm(x1)
norm(x1, "I")
norm(x1, "M")
stopifnot(all.equal(norm(x1, "F"),
                    sqrt(sum(x1^2))))

hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
h9 <- hilbert(9)
## all 5 types of norm:
(nTyp <- eval(formals(base::norm)$type))
sapply(nTyp, norm, x = h9)
# }

See Also

rcond for the (reciprocal) condition number.