R svd Function

简介:

svd()function computes the singular-value decomposition of a rectangular matrix.

svd(x, nu = min(n, p), nv = min(n, p), LINPACK = FALSE)
La.svd(x, nu = min(n, p), nv = min(n, p))

x: a numeric, logical or complex matrix 
nu: the number of left singular vectors to be computed. This must between 0 and n = nrow(x)
nv: the number of right singular vectors to be computed. This must be between 0 and p = ncol(x)
LINPACK: logical. Should LINPACK be used (for compatibility with R < 1.7.0)? In this case nu must be 0, nrow(x) or ncol(x)

> x <- matrix(1:16,4,4)
> x
     [,1] [,2] [,3] [,4]
[1,]    1    5    9   13
[2,]    2    6   10   14
[3,]    3    7   11   15
[4,]    4    8   12   16

> svd(x)
$d
[1] 3.862266e+01 2.071323e+00 2.076990e-15 4.119458e-16

$u
           [,1]       [,2]        [,3]       [,4]
[1,] -0.4284124 -0.7186535  0.43803202  0.3288281
[2,] -0.4743725 -0.2738078 -0.82913672 -0.1119477
[3,] -0.5203326  0.1710379  0.34417739 -0.7625890
[4,] -0.5662928  0.6158835  0.04692732  0.5457086

$v
           [,1]        [,2]       [,3]       [,4]
[1,] -0.1347221  0.82574206  0.5322301 -0.1293488
[2,] -0.3407577  0.42881720 -0.6132292  0.5691660
[3,] -0.5467933  0.03189234 -0.3702319 -0.7502855
[4,] -0.7528288 -0.36503251  0.4512310  0.3104683
目录
相关文章
|
14天前
|
资源调度 Serverless 计算机视觉
高斯函数 Gaussian Function
**高斯函数,或称正态分布,以数学家高斯命名,具有钟形曲线特征。关键参数包括期望值μ(决定分布中心)和标准差σ(影响分布的宽度)。当μ=0且σ²=1时,分布为标准正态分布。高斯函数广泛应用于统计学、信号处理和图像处理,如高斯滤波器用于图像模糊。其概率密度函数为e^(-x²/2σ²),积分结果为误差函数。在编程中,高斯函数常用于创建二维权重矩阵进行图像的加权平均,实现模糊效果。
14 1
|
29天前
|
机器学习/深度学习 人工智能 算法
神经网络算法——损失函数(Loss Function)
神经网络算法——损失函数(Loss Function)
22 0
|
8月前
|
机器学习/深度学习 算法 决策智能
【5分钟 Paper】(TD3) Addressing Function Approximation Error in Actor-Critic Methods
【5分钟 Paper】(TD3) Addressing Function Approximation Error in Actor-Critic Methods
|
10月前
一张图深入的理解FP/FN/Precision/Recall
一张图深入的理解FP/FN/Precision/Recall
61 0
|
索引
记忆函数——Memorize Function
记忆函数——Memorize Function
82 0
torch.autograd.Function 学习理解
文章目录 前言 一、概述 二、例程 三、官方的demo(指数函数)
234 0
|
安全 容器
Matrix Transformation(模拟)
题目描述 You have an integer matrix A, with R rows and C columns. That means it has R rows with each row containing C integers. Two integers are adjacent if their container cells share an edge.
89 0
Matrix Transformation(模拟)
|
机器学习/深度学习
人工神经网络中为什么ReLu要好过于tanh和sigmoid function?
人工神经网络中为什么ReLu要好过于tanh和sigmoid function?
人工神经网络中为什么ReLu要好过于tanh和sigmoid function?
人工神经外网络中为什么ReLu要好过于Tanh和Sigmoid Function?
人工神经外网络中为什么ReLu要好过于Tanh和Sigmoid Function?
人工神经外网络中为什么ReLu要好过于Tanh和Sigmoid Function?