Services & ResourcesWolfram ForumsMathGroup Archive

Derivative of function with indexed variables

• To: mathgroup at smc.vnet.net
• Subject: [mg83719] Derivative of function with indexed variables
• From: Laurens van der Maaten <l.vandermaaten at micc.unimaas.nl>
• Date: Thu, 29 Nov 2007 06:18:04 -0500 (EST)

I am trying to compute the following derivative in Mathematica (I wrote
it down in Latex-notation):

num = Exp[-(y_{i} - y_{j})^{2}]
den = \sum_{k=1}^{n} \sum{h=k+1}^{n} Exp[-(y_{k} - y_{h})^{2}]
expr = \sum_{j=1}^{n} p_{i,j} Log[p_{i,j} / (num / den)]
D[expr, y_{i}]

However, the resulting derivative Mathematica comes up with is
incorrect (I checked that by numerical comparison), because it does not
seem to understand that y_{k} and y_{h} will be in some cases equal to
y_{i}. How can I resolve this problem?



• Prev by Date: Re: Possible bug in HamiltonianCycle
• Next by Date: Re: Convert nxn matrix to a column vector with (n^2) elements
• Previous by thread: Style Sheets - Palette - SubScript Entry
• Next by thread: Re: Mathematica 6 and system of matrix and scalar ODEs in NDSolve:
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7257834672927856, "perplexity": 12185.633529724075}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-44/segments/1476988718296.19/warc/CC-MAIN-20161020183838-00098-ip-10-171-6-4.ec2.internal.warc.gz"}