Skip to content

HSTP #6920

@ferrine

Description

@ferrine
Member

Description

After some research, seems like if you replace Normal distribution with StudentT distribution and get HSTP

Here is a related paper as well
https://proceedings.mlr.press/v202/sellier23a.html

pymc/pymc/gp/hsgp_approx.py

Lines 322 to 331 in bc4b51d

if self._parameterization == "noncentered":
self._beta = pm.Normal(
f"{name}_hsgp_coeffs_", size=self._m_star - int(self._drop_first)
)
self._sqrt_psd = sqrt_psd
f = self.mean_func(X) + phi @ (self._beta * self._sqrt_psd)
elif self._parameterization == "centered":
self._beta = pm.Normal(f"{name}_hsgp_coeffs_", sigma=sqrt_psd)
f = self.mean_func(X) + phi @ self._beta

Turning into

        if self._parameterization == "noncentered":
            self._beta = pm.StudentT(
                f"{name}_hsgp_coeffs_", self.nu, size=self._m_star - int(self._drop_first)
            )
            self._sqrt_psd = sqrt_psd
            f = self.mean_func(X) + phi @ (self._beta * self._sqrt_psd)


        elif self._parameterization == "centered":
            self._beta = pm.StudentT(f"{name}_hsgp_coeffs_", self.nu, sigma=sqrt_psd)
            f = self.mean_func(X) + phi @ self._beta

Alternatively, you can use Fisher transfrom or any other inverse normalizing transformations to "pull out" nu

https://www.jstor.org/stable/2334301

Activity

bwengals

bwengals commented on Sep 25, 2023

@bwengals
Contributor

That's really cool, this should definitely be added. Probably could just put an additional kwarg nu=None on the HSGP class and fix the code like you did.

I don't follow the second paper though, about transforming a t distributed RV to a normal. What do you mean to pull out nu?

ferrine

ferrine commented on Sep 25, 2023

@ferrine
MemberAuthor

What do you mean to pull out nu?
It specifies non-centered parameterization (non-exact) for Student T by transforming normal distribution to StudentT

bwengals

bwengals commented on Sep 26, 2023

@bwengals
Contributor

ah I see now. I'm not sure which would work better. It's an approximation right? The first way you did it, pm.Normal -> pm.StudentT is exact and looks simpler to me

ferrine

ferrine commented on Sep 28, 2023

@ferrine
MemberAuthor

Yes, I tried exact one and it works like charm

ferrine

ferrine commented on Sep 29, 2023

@ferrine
MemberAuthor

Should it come with HSGP name or HSTP subclass? GP is Gaussian process, while T Process is different

bwengals

bwengals commented on Oct 3, 2023

@bwengals
Contributor

True... definitely less code to have nu be an optional kwarg that makes it a TP. But you're right, the code would say "GP" when it's really a t-process.

I kinda prefer the kwarg option? Though there already is a TP class

ferrine

ferrine commented on Oct 3, 2023

@ferrine
MemberAuthor

I prefer the explicit way to create a subclass

bwengals

bwengals commented on Oct 12, 2023

@bwengals
Contributor

From the user perspective I agree. For implementing it'd make for a lot of code dup, unless I'm missing something clever. Maybe have kwargs for HSGP, and also an HSTP class that calls it?

fonnesbeck

fonnesbeck commented on Oct 16, 2023

@fonnesbeck
Member

If we want to generalize, we could rename the class HSP or HSSP (stochastic process), and then specify the type of process as a keyword arg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @fonnesbeck@bwengals@ferrine@ricardoV94

      Issue actions

        HSTP · Issue #6920 · pymc-devs/pymc