Python Forum
Winsorized Mean and Standard Deviation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Winsorized Mean and Standard Deviation
#1
Hi all, Smile

I have a slight problem. I need to winsorize the means and standard deviations in my code. The code is a modification of what I have bumped into online (with a few add-ons and corrections).

The mean is denoted as:

e = numpy.mean( r )
ps. I have added spaces between brackets and r - cos it was changing it to r in circle

How would I go about winosrizing it? Here is an article on how to deal with this issue, although given how new I am to Python, I would need someone's guidance in implementation.

https://docs.scipy.org/doc/scipy/referen...orize.html

The only other instance of the "mean" I have in my code is when I calculate Information Ratio:

def information_ratio(returns, benchm):
diff = returns - benchmark
return numpy.[b]mean[/b](diff) / vol(diff)
Furthermore, would the same methodology (as for the winosrized mean) apply to the standard deviation (winsorizing it)?

Again, the only instance of the standard deviation I have listed in my code is:

return numpy.std(returns)
Please advise.

Thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Monthly sales, standard deviation Lyle 3 2,487 Aug-07-2020, 10:33 PM
Last Post: Lyle
  standard library modules chpyel 4 2,834 May-10-2020, 02:58 PM
Last Post: snippsat
  Is there a standard for autocommit In PEP 249 zatlas1 10 5,263 Feb-06-2019, 04:56 PM
Last Post: buran
  Graphics and standard deviation rocioaraneda 3 2,731 Jan-09-2019, 10:53 PM
Last Post: micseydel
  How to calculate variance(standard deviation) by column SriRajesh 2 2,842 Dec-27-2018, 12:35 PM
Last Post: SriRajesh
  standard data types rombertus 3 62,558 Dec-23-2018, 08:52 PM
Last Post: rombertus
  Standard library code BerryK 2 4,034 Apr-29-2017, 10:32 PM
Last Post: Larz60+
  what is my standard in python currently? hsunteik 3 3,750 Jan-19-2017, 12:37 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020