Using erfcinv and array indices are being rejected as not positive or valid, despite all being positive in the vector
Hello, I am currently working on some research data analysis and have been trying to fit autocorrelated data to a plot with a 95% confidence interval to check the distribution of the residuals. To do this, I’m working from the mathworks autocorrelation page (https://www.mathworks.com/help/signal/ug/residual-analysis-with-autocorrelation.html). When trying to set the confidence interval, I get the error that all array indices must be positive or logical values. Below is the code that I’m using, as well as residual data set.
erfbatp = erfcinv(a.Residuals.Raw);
erfbatp = erfbatp’;
erfbatp = erfbatp(~isnan(erfbatp))’;
conf99batp = sqrt(2)*erfbatp(2*.05/2);
lconfbatp = -conf99batp/sqrt(length(a.Residuals.Raw));
upconfbatp = conf99batp/sqrt(length(a.Residuals.Raw));
1.52973772211594
1.58151023710729
1.53641175549635
1.68852456597857
1.36494692501592
2.07737261195390
1.50753906916397
2.02256675790035
1.05155195289689
1.40278856349961
2.16079514557325
1.43199717380622
1.48556496430640
1.42827621898581
1.62133741215299
1.34671652045243
1.62813386205574
1.41104099011439
1.50196551118339
1.34604336518968
1.47733944833881
1.19896422993831
1.72322100428785
Above is the residual values in the erfbatp variable after removing NaNs, any advice or information would be appreciated.Hello, I am currently working on some research data analysis and have been trying to fit autocorrelated data to a plot with a 95% confidence interval to check the distribution of the residuals. To do this, I’m working from the mathworks autocorrelation page (https://www.mathworks.com/help/signal/ug/residual-analysis-with-autocorrelation.html). When trying to set the confidence interval, I get the error that all array indices must be positive or logical values. Below is the code that I’m using, as well as residual data set.
erfbatp = erfcinv(a.Residuals.Raw);
erfbatp = erfbatp’;
erfbatp = erfbatp(~isnan(erfbatp))’;
conf99batp = sqrt(2)*erfbatp(2*.05/2);
lconfbatp = -conf99batp/sqrt(length(a.Residuals.Raw));
upconfbatp = conf99batp/sqrt(length(a.Residuals.Raw));
1.52973772211594
1.58151023710729
1.53641175549635
1.68852456597857
1.36494692501592
2.07737261195390
1.50753906916397
2.02256675790035
1.05155195289689
1.40278856349961
2.16079514557325
1.43199717380622
1.48556496430640
1.42827621898581
1.62133741215299
1.34671652045243
1.62813386205574
1.41104099011439
1.50196551118339
1.34604336518968
1.47733944833881
1.19896422993831
1.72322100428785
Above is the residual values in the erfbatp variable after removing NaNs, any advice or information would be appreciated. Hello, I am currently working on some research data analysis and have been trying to fit autocorrelated data to a plot with a 95% confidence interval to check the distribution of the residuals. To do this, I’m working from the mathworks autocorrelation page (https://www.mathworks.com/help/signal/ug/residual-analysis-with-autocorrelation.html). When trying to set the confidence interval, I get the error that all array indices must be positive or logical values. Below is the code that I’m using, as well as residual data set.
erfbatp = erfcinv(a.Residuals.Raw);
erfbatp = erfbatp’;
erfbatp = erfbatp(~isnan(erfbatp))’;
conf99batp = sqrt(2)*erfbatp(2*.05/2);
lconfbatp = -conf99batp/sqrt(length(a.Residuals.Raw));
upconfbatp = conf99batp/sqrt(length(a.Residuals.Raw));
1.52973772211594
1.58151023710729
1.53641175549635
1.68852456597857
1.36494692501592
2.07737261195390
1.50753906916397
2.02256675790035
1.05155195289689
1.40278856349961
2.16079514557325
1.43199717380622
1.48556496430640
1.42827621898581
1.62133741215299
1.34671652045243
1.62813386205574
1.41104099011439
1.50196551118339
1.34604336518968
1.47733944833881
1.19896422993831
1.72322100428785
Above is the residual values in the erfbatp variable after removing NaNs, any advice or information would be appreciated. data analysis, residuals, autocorrelation, erfcinv MATLAB Answers — New Questions