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

  • SEARCH
  • Home
  • 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 7811617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:13:52+00:00 2026-06-02T04:13:52+00:00

I need a function like Matlab’s trimmean() in Java, and I do not want

  • 0

I need a function like Matlab’s trimmean() in Java, and I do not want to reinvent the wheel.

Anybody is aware of a ready implementation for that? (Yes, I know I can make it in no time but I wouldn’t waste time on it if someone already contributed it to the community.)

I Googled for some alternatives but I only found partial and placeholder implementations (like this or this).

Any suggestion is more than appreciated, the best would be a Maven dependency I can go play with.

Thanks in advance!

  • 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-06-02T04:13:56+00:00Added an answer on June 2, 2026 at 4:13 am

    Just for the archives, I found an acceptable solution with Colt:

    public static void trimmean(final double[] arr, final int percent) {
        if ( percent < 0 || 100 < percent ) {
            throw new IllegalArgumentException("Unexpected value: " + percent);
        }
    
        if ( 0 == arr.length ) {
            return Double.NaN;
        }
    
        final int n = arr.length;
        final int k = Math.round(n * ( percent / 100.0 ) / 2.0); // Check overflow
        final DoubleArrayList list = new DoubleArrayList( arr );
        list.sort();
        
        return Descriptive.winsorizedMean( list, Descriptive.mean( list ), k, k );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Inside a Matlab function I need something like (as you can imagine in real
I need a C rounding function which rounds numbers like MATLAB's round function. Is
I need a function just like preg_replace but instead of strings I need it
I really need some help in Regular Expressions, i'm working on a function like
I have HTML + CSS text. I need some lib with simple function like
I need to pass multiple arguments to a function that I would like to
In matlab there is a special function which is not available in any of
I need a Function like that: class Class_A { ... bool ShowVariableConstituents( CString (
here's my matlab problem. I need to write a matlab function that copies all
I want to change the appearance of a Matlab pushbutton with Java. For it,

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.