[ncl-talk] reg_multlin_stats: Y has missing values. Not allowed!

Andreas Chrysanthou eeac at leeds.ac.uk
Thu Nov 9 06:50:03 MST 2017


Hi Dennis,

I’ve played around with the code trying to find a way to tackle the missing values problem, so I interpolated my array across every dimension to fill the missing values with normal values.

Now I get the error:

fatal:divide: Division by 0, Can't continue
fatal:Div: operator failed, can't continue

The error now is caused in line 14687 in the contributed.ncl under the reg_multlin function once more. If you want to replicate the previous error you can just use as Y (dependent variable) the nies variable I’m using in my script.

I’ve put the data and the script In the ftp as per your instructions. You can find them under the names:

pp_wstar_refC1SD.zip (input diri in my code)
regressors_refC1SD.zip (input diri2 in my code)
mlr.ncl

As you can see although the input files are 6 I’m only trying to do the MLR for the first one (NIES).

Cheers,
Andreas


On 9 Nov 2017, at 02:59, Dennis Shea <shea at ucar.edu<mailto:shea at ucar.edu>> wrote:

Hello,

I can see where the error message came from:

function reg_multlin_stats(Y[*]:numeric, XP:numeric, opt)
[SNIP]
       if (isatt(Y,"_FillValue")  .and. any(ismissing(Y))) then
           print("reg_multlin_stats: Y has missing values. Not allowed!")
           exit
       end if
[SNIP]

The documentation for the underlying fortran subroutine says missing values are allowed. So, maybe I should not have that in the NCL interface. The interface subsequently calls:

https://www.ncl.ucar.edu/Document/Functions/Built-in/reg_multlin.shtml

===========================

Can you please send a clean, 'minimalistic' script that yields the error message?

Small files can be attached to the reply. If the data file is large, please use ftp:

ftp ftp.cgd.ucar.edu<http://ftp.cgd.ucar.edu/>
anonymous
your_email
cd incoming
put ....
put ...
quit

After successful transfer, send an email indicating the name(s) of the files.

Regards

On Wed, Nov 8, 2017 at 7:10 AM, Andreas Chrysanthou <eeac at leeds.ac.uk<mailto:eeac at leeds.ac.uk>> wrote:
Hi NCL users,

I’ve bumped into some missing values in my independent variable while trying to do a multiple linear regression analysis with reg_multin_stats function.

I want to produce lat/height plots (levxlat) of the predictors for the 31 years of my time series after the MLR as well as look at the Yest from those in terms of its spatial patterns.

The error I’m getting is "reg_multlin_stats: Y has missing values. Not allowed!”

PrintVarSummary of the variables I’m using is just below, whereas a snippet of the script is following after that.

Any ideas on how to get round this problem?

Variable: WSTAR
Type: float
Number of Dimensions: 4
Dimensions and sizes: [model | 6] x [year | 31] x [lev | 31] x [lat | 64]
standardize_op_ncl : dim_standardize_n over dimension(s): year
NCL : month_to_annual
actual_range : ( -0.6522911, 1e+20 )


Variable: NIES2
Type: float
Number of Dimensions: 2
Dimensions and sizes: [year | 31] x [reg_index | 5]
Number Of Attributes: 3
_FillValue : 1e+20
NCL : month_to_annual
standardize_op_ncl : dim_standardize_n over dimension(s): year



NIES1  = new ( (/5,31/), "float" )
    NIES1(0,:) = reg(0,{1980:2010},0)
    NIES1(1,:) = reg(0,{1980:2010},1)
    NIES1(2,:) = reg(0,{1980:2010},2)
    NIES1(3,:) = reg(0,{1980:2010},3)
    NIES1(4,:) = reg(0,{1980:2010},4)

NIES1!0 = "reg_index"
NIES2   = NIES1(year|:,reg_index|:)


nies = WSTAR(0,:,:,:)
test_ = test(0,:,:)

do gg = 0,dimsizes(WS_&lev)-1
    do hh = 0,dimsizes(WS_&lat)-1
        test_(gg,hh) = reg_multlin_stats(nies(:,gg,hh),NIES2,0)
    end do
end do

Cheers,
Andreas
---



_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171109/a5df5a5a/attachment.html>


More information about the ncl-talk mailing list