Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6136451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:36:17+00:00 2026-05-23T17:36:17+00:00

I have data samples arranged in a 1000 x 56 array, and I would

  • 0

I have data samples arranged in a 1000 x 56 array, and I would like to extract the parameters of a Rician distribution that best fits the data in each column. I am using the VGAM package, which seems like a perfect fit, and given the example in the documentation for riceff

vee = exp(2); sigma = exp(1);
y = rrice(n <- 1000, vee, sigma)
fit = vglm(y ~ 1, riceff, trace=TRUE, crit="c")

I figured the following code would work without a problem

nu <- rep(-1,ncol(data))
sigma <- rep(-1,ncol(data))

for( coln in seq(ncol(data)) ) {
  fdata <- c(data[,coln])
  fit <- vglm( fdata ~ 1, riceff, trace=TRUE, crit="c" )
  sigma[coln] <- matrix(Coef(fit)[1])[1,1]
  nu[coln] <- matrix(Coef(fit)[2])[1,1]
}

but instead I get the error

VGLM    linear loop  1 :  coefficients = -723936.834084,     598.301767
Error in if ((temp <- sum(wz[, 1:M, drop = FALSE] < wzepsilon))) warning(paste(temp,  : 
  argument is not interpretable as logical

as for my data, I ran some basic checks

> is.matrix(data)
[1] TRUE
> dim(data)
[1] 1000   56
> summary(data)
       V1           
 Min.   :1.402e-05  
 1st Qu.:9.533e-04  
 Median :1.548e-03  
 Mean   :1.640e-03  
 3rd Qu.:2.175e-03  
 Max.   :4.657e-03  

 ... (omitted for brevity)

      V56           
 Min.   :5.252e-05  
 1st Qu.:1.125e-03  
 Median :1.692e-03  
 Mean   :1.776e-03  
 3rd Qu.:2.293e-03  
 Max.   :5.903e-03

None of the information in the summary indicates that there is a NaN hidden somewhere, so I am at a loss as to why vglm is failing.

Does anyone have an idea as to what may be the problem? Any insight is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:36:17+00:00Added an answer on May 23, 2026 at 5:36 pm

    As suggested by Ben Bolker, here is the “solution” to my own problem (for future reference):

    The vglm function in the VGAM package does not necessarily behave well for all data inputs. Since a lot of data is often close to being Rayleigh distributed, the command just exits with that bizarre error (Koay inversion also fails, for similar reasons I assume). If I fit my data against a generalized Rayleigh distribution via genrayleigh, everything works well enough.

    One way to try both, as Ben suggested, is to use try or tryCatch to attempt both, or to emit NA values when the fitting function breaks down.

    tryCatch( {
      fit <- vglm( fdata ~ 1, riceff, trace=TRUE, crit="c" )
      # extract fit parameters here
      # ...
    }, error = function(ex) {
      # insert NA value into your data here
      # ...
    } )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Data Access Layer library that I would like to make portable.
I have data that looks like CUSTOMER, CUSTOMER_ID, PRODUCT ABC INC 1 XYX ABC
I have a double pointer data->mono_channel, where I would like to cast all the
I have a GV and a DV that extract data from the same database.
I have a byte array containing 16 & 32bit data samples, and to cast
I have a timeseries of samples in R: > str(d) 'data.frame': 5 obs. of
I have data from a table in a database (string) that contain text and
I have data that needs to be executed on a certain background thread. I
I have a bunch of histograms to plot on data that is still coming.
I have some data in CSV format that I want to pull into an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.