question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A standard for assumption vectors

See original GitHub issue

Many assumptions/hypterparameters of Estimators take on a vector-like feel along an axis of a Triangle. However, there is a great deal of inconsistency in implementation across estimators with at least five different approaches being used.

For example:

import chainladder as cl
import numpy as np
raa = cl.load_sample('raa')

# List-style approach
cl.Development(n_periods=[3]*5+[-1]*4).fit(raa)
# Dict-style approach
cl.DevelopmentConstant(
    patterns={k: 3.0**(12/k) for k in range(12, 120, 12)},
    style='cdf').fit(raa) 
# tuple-style approach
cl.TailCurve(fit_period=(3, None)).fit(raa)
# callable approach
cl.DevelopmentConstant(
    patterns=lambda x : {k: 3.0**(12/k) for k in range(12, 120, 12)},
    style='cdf').fit(raa)
#  numpy array approach
bcl, bf, cc = cl.Chainladder(), cl.BornhuetterFerguson(), cl.CapeCod()
estimators = [('bcl', bcl), ('bf', bf), ('cc', cc)]
weights = np.array([[1, 0, 0]] * 4 + [[0, 1, 0]] * 3 + [[0, 0, 1]] * 3)
cl.VotingChainladder(estimators=estimators, weights=weights) 

We need to determine a flexible standard that can can be used by all estimators. Multiple approaches should be fine but should be implemented everywhere so that users can use the style that matches their mental model. We will also need to retain backward compatibility of any deprecated approaches until the next major release.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cbalonacommented, Feb 24, 2021

In that case I think MethodBase should just have a private function that coerces the inputs to an array, and then each estimator can do with the array what it needs to after having been refactored to handle the array.

0reactions
jbogaardtcommented, Feb 25, 2021

makes sense

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 30 Assumptions of the Regression Model
In this chapter, you will learn about how matrix algebra is used to express and understand the distributional assumptions underlying the regression model....
Read more >
Random Vectors - Probability Course
Here, we assume X is a real random vector, i.e., the Xi's can only take real values. A special important property of the...
Read more >
Practical Question about the Assumptions of Support Vector ...
As far as I know, the only assumptions of support vector machines are independent and identically distributed data.
Read more >
4.4 The Least Squares Assumptions
We start by creating a vector containing values that are uniformly distributed on the interval [−5,5] [ − 5 , 5 ] ....
Read more >
8.10 - Two-way MANOVA Additive Model and Assumptions
Assumptions · The error vectors ε i j have zero population mean; · The error vectors ε i j have common variance-covariance matrix...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found