(common_offset)=

# Common offset

```{warning}
This page is a stub generated by Codex. The content has been verified, but important information (references, links to external packages) may be missing  
```

The `common_offset` model replaces the local offset parameters defined by the offset flags in the dataset file with a single offset parameter shared by all datasets using the same common model.

This is useful when several files represent the same instrumental zero point, or when datasets of the same observable have been split into seasons but should still share the same baseline. For example, radial velocities from the same instrument can be split into different observing seasons for the stellar-activity model while still using one common systemic velocity.

```{note}
When `common_offset` is applied to a dataset, the local offset flags of that dataset are deactivated internally. This avoids fitting both a local offset and a shared offset for the same data.
```

## Model definition and requirements

- model name: `common_offset`
- required common object: `common_offset`

The offset boundaries are estimated automatically from the datasets using the model. If more than one dataset shares the same common offset, the default boundary is expanded to include the ranges of all of them.

## Keywords

There are no model-wide keywords.

## Examples

In the following example, two RV datasets share the same offset parameter even if they are stored in different files. The two datasets can still have independent models for other effects, such as seasonal Gaussian processes.

```yaml
inputs:
  RV_HARPS_s01:
    file: datasets/HARPS_s01_PyORBIT.dat
    kind: RV
    models:
      - radial_velocities
      - common_offset_RV
  RV_HARPS_s02:
    file: datasets/HARPS_s02_PyORBIT.dat
    kind: RV
    models:
      - radial_velocities
      - common_offset_RV
common:
  planets:
    b:
      orbit: circular
      use_time_inferior_conjunction: True
      boundaries:
        P: [2.0, 3.0]
        K: [0.0, 20.0]
        Tc: [59000.0, 59001.0]
  common_offset_RV:
    model: common_offset
models:
  radial_velocities:
    planets:
      - b
```

If needed, the prior or boundaries can be specified directly in the common object:

```yaml
common:
  common_offset_RV:
    model: common_offset
    boundaries:
      offset: [-100.0, 100.0]
    priors:
      offset: ['Gaussian', 0.0, 20.0]
```

The same pattern can be repeated for different observables:

```yaml
common:
  common_offset_RV:
    model: common_offset
  common_offset_BIS:
    model: common_offset
  common_offset_Sindex:
    model: common_offset
```

## Model parameters

The following parameters will be inherited from the common model.

| Name | Parameter | Common? | Definition | Notes |
| :--- | :-------- | :------ | :--------- | :---- |
| `offset` | Additive zero point of the dataset | common | `common_offset` | Same units as the dataset values |
