BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class RadialVelocityModel( NonLinearModel )Source

Model for the radial velocity variations of a star caused by a orbiting planet.

par symbol name description limits comment
p0 e eccentricity of the elliptic orbit 0<e<1 0 = circular
p1 a amplitude of the velocity variation a>0
p2 P period of the velocity variation P>0
p3 T phase phase since periastron 0<T<2π
p4 ω periastron longitude of periastron 0<ω<2π

This class uses Kepplers2ndLaw to find radius and true anomaly.

Note The velocity of the star system is not included in this model. See example.

The parameters are initialized at [0.0, 1.0, 1.0, 0.0, 0.0]. It is a non-linear model.

Attributes

  • keppler : Kepplers2ndLaw()
         to calculate the radius and true anomaly

Examples

rv = RadialVelocityModel( )
print( rv.npars )
5
rv += PolynomialModel( 0 )          # add a constant system velocity

RadialVelocityModel( copy=None, **kwargs )

Radial velocity model.

Number of parameters is 5

Parameters

  • copy : RadialVelocityModel
         model to copy
  • fixed : dictionary of {int:float}
         int list if parameters to fix permanently. Default None.
         float list of values for the fixed parameters.
         Attribute fixed can only be set in the constructor.

copy( )

Copy method.

getMsini( stellarmass )
Return the mass of the exoplanet in Jupiter masses.

Parameters

  • stellarmass : float
         mass of the host star in solar masses.

baseResult( xdata, params )
Returns the result of the model function.

f(x:p) = p1 * ( cos( v + p4 ) + p0 * cos( p4 ) )

where v is the true anomaly

Parameters

  • xdata : array_like
         values at which to calculate the result
  • params : array_like
         values for the parameters.

basePartial( xdata, params, parlist=None )
Returns the partials at the input value.

f(x:p) = p1 * ( cos( v + p4 ) + p0 * cos( p4 ) )

  df/dp0 = p1 * ( - sin( v + p4 ) dv/dp0 + cos( p4 ) )
  df/dp1 = cos( v + p4 ) + p0 * cos( p4 )
  df/dp2 = - p1 * sin( v + p4 ) dv/dp2
  df/dp3 = - p1 * sin( v + p4 ) dv/dp3
  df/dp4 = - p1 * ( sin( v + p4 ) + p0 * sin( p4 ) )

Parameters

  • xdata : array_like
         values at which to calculate the result
  • params : array_like
         values for the parameters.
  • parlist : array_like
         list of indices active parameters (or None for all)

baseDerivative( xdata, params )
Returns the derivative of f to x (df/dx) at the input values.

dfdx = - p1 * sin( v + p4 ) * dvdx

Parameters

  • xdata : array_like
         values at which to calculate the result
  • params : array_like
         values for the parameters.

baseName( )
Returns a string representation of the model.

baseParameterUnit( k )
Return the unit of a parameter.

Parameters

  • k : int
         the kth parameter.
Methods inherited from NonLinearModel
Methods inherited from Model
Methods inherited from FixedModel
Methods inherited from BaseModel