简体   繁体   English

svd(X)中的错误:'x'中的值无穷或缺失。 在GAS中使用BacktestVaR时

[英]Error in svd(X) : infinite or missing values in 'x' . when using BacktestVaR in GAS

I want to use BacktestVaR function in GAS package the data file is here returns 我想在GAS包中使用BacktestVaR函数,数据文件在这里返回

returns1 <- return[,-1]
BacktestVaR(returns1,0.9998714,0.05)

When I run the above code I get:- 当我运行上面的代码时,我得到:

"Error in svd(X) : infinite or missing values in 'x'" “ svd(X)中的错误:'x'中的值无穷或缺失”

Can some one please help me with this? 有人可以帮我吗?

I guess there's a problem with your VaR argument. 我猜您的VaR参数有问题。 It expects a numeric vector containing VaR series and you are passing 0.9998714. 它期望一个包含VaR系列的数值向量,并且您正在传递0.9998714。

There's an example given in the package documentation which you can have a look at. 软件包文档中提供了一个示例,您可以看一下。

I tried an example given in the package on your data and it worked fine for me. 我尝试了您的数据包中提供的示例,它对我来说很好用。

library(GAS)
returns1 <- return[,-1]
Forecast = UniGASFor(Fit, Roll = TRUE, out = returns1)
alpha = 0.05
VaR = quantile(Forecast, alpha)
BacktestVaR(returns1, VaR, alpha)

It gave an output:- 它给出了一个输出:

$LRuc
        Test       Pvalue 
1.508023e+01 1.030369e-04 

$LRcc
        Test       Pvalue 
1.508023e+01 5.313369e-04 

$AE
[1] 0

$AD
ADmean  ADmax 
   NaN   -Inf 

$DQ
$DQ$stat
         [,1]
[1,] 7.526316

$DQ$pvalue
          [,1]
[1,] 0.3762069


$Loss
$Loss$Loss
[1] 0.02396477

$Loss$LossSeries
  [1] 0.099206718 0.089934791 0.085306377 0.083944161 0.078122362 0.073599847 0.061635033
  [8] 0.064839991 0.059715813 0.065246570 0.061809442 0.055136995 0.052664206 0.052750109
 [15] 0.048890123 0.043372077 0.043033141 0.045092669 0.042304367 0.037946743 0.041365010
 [22] 0.037392398 0.041342509 0.037154130 0.034005277 0.035064542 0.024833787 0.032198291
 [29] 0.026951766 0.032110073 0.025078754 0.019482687 0.029475914 0.031723679 0.022555941
 [36] 0.012634228 0.020209926 0.028950001 0.026904561 0.028708228 0.031490940 0.031142592
 [43] 0.039528132 0.023939675 0.036555585 0.025622543 0.030231260 0.020470378 0.028312997
 [50] 0.025243985 0.018476646 0.022936782 0.024340429 0.021230794 0.019276576 0.023544289
 [57] 0.019724022 0.021008776 0.022342456 0.019971455 0.018544509 0.017889817 0.010320351
 [64] 0.013567978 0.023370654 0.018427862 0.013352942 0.015784444 0.016032580 0.013898405
 [71] 0.016405078 0.021259721 0.009921251 0.013944924 0.022224791 0.019584060 0.016001481
 [78] 0.017540380 0.006435535 0.018837333 0.013470815 0.015819393 0.021200104 0.014361778
 [85] 0.017106075 0.017225547 0.012276949 0.011625625 0.011784346 0.018752417 0.014791428
 [92] 0.011591563 0.012849788 0.011635476 0.017176090 0.018051420 0.014120935 0.012636333
 [99] 0.009913736 0.017225520 0.015406386 0.012874489 0.016547533 0.014883970 0.012906750
[106] 0.017762996 0.013358853 0.014217855 0.013441140 0.010019856 0.015160385 0.011431101
[113] 0.009502256 0.008921462 0.013421278 0.010276422 0.012234584 0.007779987 0.009893465
[120] 0.013416031 0.013245883 0.009740190 0.006903344 0.007681396 0.018183227 0.012966043
[127] 0.013923885 0.012345783 0.014619745 0.013296054 0.011492134 0.010751146 0.006154623
[134] 0.011448771 0.014871403 0.010247001 0.012144674 0.012527776 0.013672466 0.008994635
[141] 0.012822531 0.008867439 0.011508661 0.012899977 0.009832727 0.013247198 0.009932820


Warning message:
In max(series) : no non-missing arguments to max; returning -Inf

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R - svd()函数 - &#39;x&#39;中的无限或缺失值 - R - svd() function - infinite or missing values in 'x' svd(x, nu = 0, nv = k) 中的错误:“x”中的值无限或缺失。 矩阵中没有 NA 或 Inf 值 - Error in svd(x, nu = 0, nv = k) : infinite or missing values in 'x'. There are no NA or Inf values in matrix R 中的 PCA:svd(x,nu=0,nv=k)中的错误:“x”中的值无限或缺失 - PCA in R: Error in svd(x, nu=0, nv=k) : Infinite or missing values in 'x' svd(x,nu = 0)中的错误:&#39;x&#39;中的值无限或缺失(检查是否存在负值) - Error in svd(x, nu = 0) : infinite or missing values in 'x' (checked no negative values exist) R MASS软件包中的lm.ridge()说“ svd(X)中的错误:&#39;x&#39;中的值无穷或缺失” - lm.ridge() in R MASS package saying “Error in svd(X) : infinite or missing values in 'x'” R:采样:校准函数:svd(X)中的错误:“ x”中的值无穷或缺失 - R: Sampling: Calib function: Error in svd(X) : infinite or missing values in 'x' 计算R错误中的SVD:缺失值或无限值 - Calculate SVD in R error: missing or infinite values 特征(x)中的错误:“x”中的无限值或缺失值 &gt; 在 robumeta 中 - Error in eigen(x) : infinite or missing values in 'x' > in robumeta R-&#39;x&#39;中的无穷或缺失值 - R - Infinite or missing values in 'x' 非线性优化问题中的错误:“ x”中的值无穷或缺失 - Error in nonlinear optimization problem : infinite or missing values in 'x'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM